XML : Sending xml via soapclient in PHP

I am very new to using Web Services and understanding XML. If you feel I should read some tutorials or documentation I'd be greatful if you could supply some links.

I am trying to execute a simple function via a web service,

In the documentation that was provided I have the following information...

Web Service Input Parameters:

id , data type = xs:string , lenght: 10

password , data type = xs:string , lenght: 25

group , data type = xs:string , length: 20

orderxml , data type = xs:string , length: 2^16

I have been given sample xml for the last paramater , when I try and run the function I get the following error.

Fatal error: Uncaught SoapFault exception: [a:InternalServiceFault] Value cannot be null. Parameter name: property in

   $client = new SoapClient('http://www.example.com/service?wsdl');   $xml = '<samplexml> </samplexml>';   $response = $client->Import(   array(      'Id' => '1234',      'password' => '123456',      'group' => 'test1',      'orderxml' => $xml    ));    

When I try

   $response = $client->Import('test', 'test');    

I get the following...

I tried the second one thinking perhaps I need to send raw XML?

Fatal error: Uncaught SoapFault exception: [a:DeserializationFailed] The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'Import'. End element 'Body' from namespace 'http://schemas.xmlsoap.org/soap/envelope/' expected. Found element 'param1' from namespace ''. Line 2, position 162. in

No comments:

Post a Comment