我对 PHP 比较陌生,对 VB.NET / Web 服务 / SOAP / XML 完全陌生,我无法让我的 PHP 与 VB.NET Web 服务通信。
这是我的 PHP 脚本:
<?php
$client = new SoapClient("http://10.0.0.2/wsteste/Service1.asmx?wsdl");
$param = array("usuario" => "name", "senha" => "test");
$response = $client->__soapCall("HelloWorld", $param);
print_r($response);
?>
这是 VB.NET asmx。
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class Service1
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld(ByVal usuario As String, ByVal senha As String) As String
Return usuario & " - " & senha
End Function
End Class
这是浏览器上打印的内容:
stdClass Object ( [HelloWorldResult] => - )
它应该返回name - test
,不是吗?