0

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?

Klemen Tusar
  • 9,261
  • 4
  • 31
  • 28
  • Possible duplicate of [What is a NullReferenceException, and how do I fix it?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – tom redfern Jan 11 '17 at 10:31

1 Answers1

2

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

Daveo
  • 1,155
  • 2
  • 8
  • 16
  • Aha, ok. So what you're saying is I need to tell the guys that own the server to fix their C# code? Sadly there is no way for me to do it since I don't have access to the server neither have any knowledge of C#. – Klemen Tusar Nov 11 '11 at 07:43