PHP、SOAP、.NET - 未将对象引用设置为对象的实例
我一直在尝试设置一个基于 PHP 的 SOAP 客户端来与另一个 .NET SOAP 服务器连接,但没有成功。 :/ 我已经尝试了几乎所有我能想到的以及 Google 叔叔能找到的东西 - NuSOAP、Zend Framework SOAP 和 PHP 的内部 SOAP。所有 3 个都给了我错误,但 PHP 的内部 SOAP 似乎是最简单和最有前途的。好吧,所以我又花了 2 天时间研究 PHP 的内部 SOAP 客户端,最后我遇到了这个错误:
SoapFault 异常:[soap:Server] System.Web.Services.Protocols.SoapException:服务器无法处理请求。 ---> System.NullReferenceException:未将对象引用设置为对象的实例。
位于 c:\inetpub\wwwroot\p_client\p_client.asmx.cs 中的 p_client.p_data.read(PgSqlDataReader e):第 642 行
p_client.p_client.p_login(Int32 pid, 字符串用户名, 字符串密码) in c:\inetpub\wwwroot\p_client\p_client.asmx.cs:line 172
--- 内部异常堆栈跟踪结束 --- 在 /home/techhouse/public_html/beta/test/new2_soap_client.php:76< br>堆栈跟踪:
#0 /home/techhouse/public_html/beta/test/new2_soap_client.php(76): SoapClient->__soapCall('p_login', Array)
#1 {main}
我的请求 XML 如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.dhimahi.com/">
<SOAP-ENV:Body>
<ns1:p_login>
<ns1:pid>1234</ns1:pid>
<ns1:username>username1234</ns1:username>
<ns1:password>password1234</ns1:password>
</ns1:p_login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
有什么想法如何解决这个问题吗?
I have been trying to set up a PHP based SOAP client to connect with another .NET SOAP server, but without any luck. :/ I've tried just about anything I could think of and what uncle Google could find - NuSOAP, Zend Framework SOAP and PHP's internal SOAP. All 3 gave me errors, but PHP's internal SOAP seemed most simple and promising. Well, so I invested another 2 days into PHP's internal SOAP client and at the end I landed with this error:
SoapFault exception: [soap:Server] System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at p_client.p_data.read(PgSqlDataReader e) in c:\inetpub\wwwroot\p_client\p_client.asmx.cs:line 642
at p_client.p_client.p_login(Int32 pid, String username, String password) in c:\inetpub\wwwroot\p_client\p_client.asmx.cs:line 172
--- End of inner exception stack trace --- in /home/techouse/public_html/beta/test/new2_soap_client.php:76
Stack trace:
#0 /home/techouse/public_html/beta/test/new2_soap_client.php(76): SoapClient->__soapCall('p_login', Array)
#1 {main}
My request XML looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.dhimahi.com/">
<SOAP-ENV:Body>
<ns1:p_login>
<ns1:pid>1234</ns1:pid>
<ns1:username>username1234</ns1:username>
<ns1:password>password1234</ns1:password>
</ns1:p_login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Any ideas how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该错误来自.NET 端。尝试使用空对象时会引发该错误。
The error is from the .NET side. The error is thrown when trying to use an object that is null.