PHP,SOAP,.NET-未将对象引用设置为对象的实例 [英] PHP, SOAP, .NET - Object reference not set to an instance of an object

查看:62
本文介绍了PHP,SOAP,.NET-未将对象引用设置为对象的实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试建立一个基于PHP的SOAP客户端以与另一个.NET SOAP服务器连接,但是没有任何运气.://我已经尝试了几乎所有我能想到的东西以及Google叔叔能找到的东西-NuSOAP,Zend Framework SOAP和PHP的内部SOAP.这3个都给了我错误,但是PHP的内部SOAP看起来最简单也最有希望.好吧,所以我又花了两天时间到PHP的内部SOAP客户端中,最后我遇到了这个错误:

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}

我的请求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>

有什么办法解决这个问题吗?

Any ideas how to fix this?

推荐答案

该错误来自.NET.尝试使用空对象时抛出该错误.

The error is from the .NET side. The error is thrown when trying to use an object that is null.

这篇关于PHP,SOAP,.NET-未将对象引用设置为对象的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆