I have to make a script that sends a order (XML) to a SOAP client server (this way the supplier can handle the order)
I tried everything but it doesn't work.
Does anybody know what I'm doing wrong?
This is what I have so far:
<?php
$xmlstr = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.datacontract.org/2004/07/Centric.CS.Trade.Standard.WS.SalesOrderService.Contract.Request" xmlns:ns2="http://centric.eu/services/CS/Trade/Standard/WS/">
<SOAP-ENV:Body>
<ns2:LoadSalesOrder>
<ns2:request>
<ns1:SalesOrderRequests>
<ns1:SalesOrderRequest>
<ns1:DeliveryAddress/>
<ns1:DeliveryAddress1>teststraat</ns1:DeliveryAddress1>
<ns1:DeliveryCountry>NL</ns1:DeliveryCountry>
<ns1:DeliveryEmail>test@test.nl</ns1:DeliveryEmail>
<ns1:DeliveryFetchCarrier>true</ns1:DeliveryFetchCarrier>
<ns1:DeliveryFetchDeliveryMode>true</ns1:DeliveryFetchDeliveryMode>
<ns1:DeliveryHouseNo>1</ns1:DeliveryHouseNo>
<ns1:DeliveryMunicipality>ALKMAAR</ns1:DeliveryMunicipality>
<ns1:DeliveryName>Test naam</ns1:DeliveryName>
<ns1:DeliveryPermanent>false</ns1:DeliveryPermanent>
<ns1:DeliveryPhone>06-12345678</ns1:DeliveryPhone>
<ns1:DeliveryPostalCode>1200 RT</ns1:DeliveryPostalCode>
<ns1:Division>AGU_NL</ns1:Division>
<ns1:Key>02</ns1:Key>
<ns1:Language>NL</ns1:Language>
<ns1:Login>7440475</ns1:Login>
<ns1:OrderCustomer>7440475</ns1:OrderCustomer>
<ns1:OrderLines>
<ns1:SalesOrderRequest.OrderLine>
<ns1:Item>113504</ns1:Item>
<ns1:Line>10</ns1:Line>
<ns1:OrderQuantityBU>1.0000</ns1:OrderQuantityBU>
</ns1:SalesOrderRequest.OrderLine>
</ns1:OrderLines>
<ns1:OrderType>100</ns1:OrderType>
<ns1:ReferenceExternal>100000001</ns1:ReferenceExternal>
</ns1:SalesOrderRequest>
</ns1:SalesOrderRequests>
</ns2:request>
</ns2:LoadSalesOrder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML;
$wsdl = 'https://ws.abcb2b.eu/Centric/CS/Trade/cstest/SalesOrderService.svc?wsdl';
$client = new SoapClient($wsdl, array(
'cache_wsdl' => WSDL_CACHE_NONE,
'cache_ttl' => 86400,
'trace' => true,
'exceptions' => true,
));
$xmlVar = new SoapVar($xmlstr, XSD_ANYXML);
$client->LoadSalesOrder($xmlstr);
?>
Fatal error: Uncaught SoapFault exception: [s:Client] The creator of this fault did not specify a Reason. in C:\wamp\soap_request.php:102 Stack trace: #0 C:\wamp\www\soap_request.php(102): SoapClient->__call('LoadSalesOrder', Array) #1 C:\wamp\www\soap_request.php(102): SoapClient->LoadSalesOrder('
</div>