Soap problems connecting to .NET server

General discussion on Zend Server for IBM System i
Post Reply
Posts: 34
Joined: Mon Feb 13, 2012 5:17 pm

Soap problems connecting to .NET server

Post by deathcomp » Wed Mar 21, 2012 4:16 pm

So we are just starting to learn how to use soap with php. So I'm pretty new with this. We decided to consume a simple stock quote web service to start with because it was very simple. However, we are getting an error and from what I read it's a problem with php/soap talking to .NET soap servers. Anyone get this error and figure out a solution?

Code: Select all


$wsdl = "";
$endpoint = "";
 $client = new SoapClient($wsdl, array('location'=>$endpoint,

$value = $client->GetStockQuote('IBM');

print "<pre>\n";

print "<br />\n Request : ".htmlspecialchars($client->__getLastRequest());

print "<br />\n Response: ".htmlspecialchars($client->__getLastResponse());

print "</pre>";

Here's the output:

Code: Select all

 Request : <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns1=""><SOAP-ENV:Body><ns1:GetStockQuote/></SOAP-ENV:Body></SOAP-ENV:Envelope>

 Response: <s:Envelope xmlns:s=""><s:Body><s:Fault><faultcode xmlns:a="">a:InternalServiceFault</faultcode><faultstring xml:lang="en-US">Object reference not set to an instance of an object.</faultstring><detail><ExceptionDetail xmlns="" xmlns:i=""><HelpLink i:nil="true"/><InnerException i:nil="true"/><Message>Object reference not set to an instance of an object.</Message><StackTrace>   at GOTLServices.ServiceImplementation.StockQuoteService.GetStockQuote(String symbol)&#xD;
   at SyncInvokeGetStockQuote(Object , Object[] , Object[] )&#xD;
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)&#xD;
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)&#xD;
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace><Type>System.NullReferenceException</Type></ExceptionDetail></detail></s:Fault></s:Body></s:Envelope>
For testing purposes we installed soapui to test this as well. It works just fine when we put 'IBM' in the request. However it's also a .NET client.

Any help would be greatly appreciated.

Posts: 82
Joined: Wed Aug 12, 2009 7:58 am
Location: Tampere, Finland

Re: Soap problems connecting to .NET server

Post by timo_karvinen » Mon May 14, 2012 10:33 am

Actually SoapUI is Java program, not .NET.

About your actual problem, I'm not sure about the cause of that, but when I was starting out with SOAP Web Services and I had problems with getting everything right agains .NET services/clients I went with NuSOAP toolkit because regular PHP Soap didn't seem to work very well in those situations.

Maybe you should try it out:


Post Reply