Benmcfc Posted April 3, 2009 Share Posted April 3, 2009 Hi all, First off, apologies if this is in the wrong section of the forums. I know there's a lot of results in Google for this but I've been unable to fix it. try { //vars $userName = "someusername"; $password = "somepw"; $request = array( 'UserName' => $userName, 'Password' => $password, 'Transaction' => array( 'ID' => '001', 'TransID' => '000001', 'Reference' => 'some_string_0101', 'SchemeCode' => 'abc', 'ClientReference' => 'some_string', 'Branch' => 'some_string', 'SchemeBrokerNo' => '42', 'SaveState' => 'Pending', ), 'SaveState' => 'Pending' ); //soap include 'lib/nusoap.php'; $namespace = "XMLTransferServiceProxy"; $soapACTION = "path/to/action/url"; $URL = "path/to/xmltransferengine.asmx"; $client = new SoapClient($URL); $client->useHTTPPersistentConnection(); $SaveTransaction = $client -> call("SaveTransaction", $request, $namespace, $soapACTION); } catch(SoapFault $fault){ echo "SoapFault: ".$fault; } print_r($client); This is the soap request: POST /services/xmltransferengine.asmx HTTP/1.1 Host: host User-Agent: NuSOAP/0.7.3 (1.114) Connection: close Content-Type: text/xml; charset=UTF-8 SOAPAction: "path/to/soap/action/method" Content-Length: 1089 <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body><ns8502:SaveTransaction xmlns:ns8502="XMLTransferServiceProxy"> <UserName xsi:type="xsd:string">someusername</UserName> <Password xsi:type="xsd:string">somepw</Password> <Transaction> <ID xsi:type="xsd:string">001</ID> <TransID xsi:type="xsd:string">000001</TransID> <Reference xsi:type="xsd:string">some_string_0101</Reference> <SchemeCode xsi:type="xsd:string">abc</SchemeCode> <ClientReference xsi:type="xsd:string">some_string</ClientReference> <Branch xsi:type="xsd:string">some_string</Branch> <SchemeBrokerNo xsi:type="xsd:string">42</SchemeBrokerNo> <SaveState xsi:type="xsd:string">Pending</SaveState> </Transaction> <SaveState xsi:type="xsd:string">Pending</SaveState> </ns8502:SaveTransaction> </SOAP-ENV:Body> </SOAP-ENV:Envelope> This is the soap response from the server: HTTP/1.1 500 Internal Server Error. Date: Fri, 03 Apr 2009 09:30:53 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 1.1.4322 Cache-Control: private Content-Type: text/xml; charset=utf-8 Content-Length: 488 <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Server was unable to process request. --> Object reference not set to an instance of an object.</faultstring> <detail /> </soap:Fault> </soap:Body> </soap:Envelope> As I said, I've visited a number of the results Google brought up for the error code, but have been unable to find the cause of the problem and fix it. Any help would be much appreciated. Quote Link to comment Share on other sites More sharing options...
Benmcfc Posted April 5, 2009 Author Share Posted April 5, 2009 Anyone? Quote Link to comment Share on other sites More sharing options...
bholub Posted April 21, 2009 Share Posted April 21, 2009 I'm seeing this now... did you ever find a solution? Thanks, Brian Quote Link to comment Share on other sites More sharing options...
soak Posted April 21, 2009 Share Posted April 21, 2009 The error messages is being gererated by the SOAP server you're connecting to. Either your request is incorrectly formatted / missing bits or there is a fault with the SOAP server you are connecting to. Quote Link to comment Share on other sites More sharing options...
bholub Posted April 21, 2009 Share Posted April 21, 2009 that's what i was afraid of, i'm trying to work off of just the WSDL file.... in this case that may not be enough. thanks Quote Link to comment Share on other sites More sharing options...
soak Posted April 21, 2009 Share Posted April 21, 2009 The WSDL should be enough to generate a valid request. That's pretty much what it's for, to define a valid request. Might be worth adding every field in the wsdl to your request, seeing if it works then if so, working back from there. Quote Link to comment Share on other sites More sharing options...
bholub Posted April 21, 2009 Share Posted April 21, 2009 yep, i thought i could leave out fields that had "minOccurs" = 0... but turns out that's not the case. once i add all the fields it works. my b thanks a lot for the help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.