SOAP Request & Response

PEAR, Smarty, ADOdb, OOP, PHP 5, XML, UML, Şabloane de proiectare, PHP-GTK.

Moderatori: coditza, Emil, Moderatori

patru
PHPRomania Supporter
Mesaje: 12
Membru din: Vin Feb 07, 2014 11:16 am

SOAP Request & Response

Mesajde patru » Mie Mai 06, 2015 2:14 pm

i want to make a SOAP request to the server. But i'm struggling with an error. This is how the XML should look like:

<ExternalOrder Ref="85" Version="2">
<Orders>
<Order Operation="Add" Client="1">
<Item Operation="Add">
<ItemId>244</ItemId>
<Description>coke</Description>
<Quantity>2</Quantity>
<Price>1.75</Price>
</Item>
</Order>
</Orders>
</ExternalOrder>

Here is my PHP code:

$client = new SoapClient('http://11.30.11.151/ProxyWebService/ProxyService.asmx?WSDL', array('trace' => true));
$result = $client->__soapCall('AddOrder', array(
'ExternalOrder' => [
'Orders' => [
'Order' => [
'Item' => [
'ItemId' => '244',
'Description' => 'coke',
'Quantity' => '2',
'Price' => '1.75'
],
]
]
]
));

?>

Server response: Object reference not set to an instance of an object.



Înapoi la “PHP Avansat”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 20 vizitatori