Hello, i try to make a request with SOAP. Here is my code:
-------------------------------------------------------------------------------------------------------
$client = new SoapClient('http://11.30.11.155/ProxyWebService/ProxyService.asmx?WSDL');
$response = $client->__doRequest ( '
<ExternalOrder Ref="85" Version="2"><StopOnError>Yes</StopOnError><NoDiscrepancyMedia>Yes</NoDiscrepancyMedia><RefData>Add</RefData><DateOrdered>2011-11-21</DateOrdered><TimeOrdered>9:26:00</TimeOrdered><DateDelivery>2011-11-21</DateDelivery><TimeDelivery>11:00:00</TimeDelivery><TimePreparation>11:00:00</TimePreparation><Workstation>3</Workstation><Mode>2</Mode><RevenueCenter>4</RevenueCenter><Function>Delivery</Function><PickUp>No</PickUp><SendToKitchen>Yes</SendToKitchen><CloseInvoice>No</CloseInvoice><Customer><AreaCode>514</AreaCode><Phone>4991000</Phone><Company>La compagnie creole</Company><Extension>111</Extension><Name>Amélie Lavâllée</Name><Address><Number>6500</Number><Street>BOUL SAINT LAURENT</Street><AptNum>A</AptNum><Near>BERRI</Near><CityState>MONTREAL, QC</CityState><ZipCode>HOHOHO</ZipCode><ZoneReferenceNumber>J7G-011</ZoneReferenceNumber><ZoneDescription>Centre-Ville</ZoneDescription></Address><Remark>Faire att aux chiens</Remark><Remark>Faire att aux chats</Remark><Remark>Ils mordent</Remark><SpecialRemark>Porte gauche</SpecialRemark><SpecialRemark>Ne pas sonner</SpecialRemark></Customer><Orders><Order Operation="Add" Client="1"><Item Operation="Add"><ItemId>244</ItemId><Description>coke</Description><Quantity>2</Quantity><Price>1.75</Price></Item><Discounts/><Charges><Service><Amount>0.00</Amount></Service><Gratuity><Amount>0.00</Amount></Gratuity><Delivery><Amount>0.00</Amount></Delivery></Charges><Taxes><Tax><TaxId>1</TaxId><Amount>0.53</Amount></Tax></Taxes><Medias><Media><MediaId>1</MediaId><Amount>4.03</Amount><Tip>0.00</Tip><Description></Description><Folio></Folio></Media></Medias></Order></Orders></ExternalOrder>
' ,
'http://11.30.11.155/ProxyWebService/ProxyService.asmx?WSDL' , 'AddOrder' , SOAP_1_1 );
print_r($response);
die;
Expected results: Add order and receive an XML with server response.
Actual result: "soap:ClientServer did not recognize the value of HTTP Header SOAPAction: AddOrder."
Here is the result:
<?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:Client</faultcode><faultstring>Server did not recognize the value of HTTP Header SOAPAction: AddOrder.</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>
Soap Error: ClientServer did not recognize the value of HTTP
Moderatori: coditza, Emil, Moderatori
-
- Senior Member
- Mesaje: 1264
- Membru din: Mar Iun 22, 2010 3:17 pm
Re: Soap Error: ClientServer did not recognize the value of
Scoate "?WSDL" din URL.
Facusi un canal de php pe freenode - ##php-ro : https://webchat.freenode.net/
Re: Soap Error: ClientServer did not recognize the value of
daca scot "?WSDL" din URL primesc Fatal Error:
----------------------------------------------------------------------
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://11.30.11.155/ProxyWebService/ProxyService.asmx' : Premature end of data in tag html line 3 in /var/www/html/dashboard/soap-test.php:14 Stack trace: #0 /var/www/html/dashboard/soap-test.php(14): SoapClient->SoapClient('http://11.30.11...', Array) #1 {main} thrown in /var/www/html/dashboard/soap-test.php on line 14
----------------------------------------------------------------------
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://11.30.11.155/ProxyWebService/ProxyService.asmx' : Premature end of data in tag html line 3 in /var/www/html/dashboard/soap-test.php:14 Stack trace: #0 /var/www/html/dashboard/soap-test.php(14): SoapClient->SoapClient('http://11.30.11...', Array) #1 {main} thrown in /var/www/html/dashboard/soap-test.php on line 14
Cine este conectat
Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 12 vizitatori