L'intestazione SOAP non viene impostata

Sto cercando di submit l'intestazione di authentication in SOAP ma non funziona e continua a mostrare errori come "Informazioni di authentication non valide".

$options=arrays( 'senderCity'=>'Atlanta', 'senderState'=>'GA', 'senderZip'=>'30005', 'senderCountryCode'=>'USA', 'receiverCity'=>'Atlanta', 'receiverState'=>'GA', 'receiverZip'=>'30005', 'receiverCountryCode'=>'USA' ); $headerbody = arrays( 'loginId'=>'xxxxxxxx', 'password'=>'xxxxxxxx', 'licenseKey'=>'xxxxxxxxxxxxx', 'accountNumber'=>'xxxxxxxxxx'); $soap_client = new SoapClient('http://www.wwexship.com/webServices/services/SpeedFreightShipment?wsdl'); $header = new SoapHeader('http://www.wwexship.com/webServices/', 'AuthenticationToken', $headerbody, false); $soap_client->__setSoapHeaders(arrays($header)); $result = $soap_client->__call('quoteSpeedFreightShipment',$options); echo "<pre>"; print_r($result); echo "<pre>"; 

Qualcuno può aiutarmi a risolvere questo.

Grazie

Correggere il tuo spazio dei nomi,

 $header = new SoapHeader('http://www.wwexship.com', 'AuthenticationToken', $headerbody, false); 

Bene, ho ottenuto la soluzione in modo da postarla qui … alless salvare questa soluzione e inviarlo agli utenti interessati in modo che possano usarlo

Passi per testare

  1. Crea una pagina PHP
  2. Copia incolla sotto il codice
  3. Cambia l'utente, pwd, acct # e digita il text variabile soap_request …
  4. Codice

========================

 <?php $url = "http://www.wwexship.com/webServices/services/SpeedFreightShipment"; $soap_request = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wwex="http://www.wwexship.com"> <soapenv:Header> <wwex:AuthenticationToken> <wwex:loginId>LOGIN_ID</wwex:loginId> <wwex:password>PASSWPRD</wwex:password> <wwex:licenseKey>LIC_KEY</wwex:licenseKey> <wwex:accountNumber>ACCT_NUMB</wwex:accountNumber> </wwex:AuthenticationToken> </soapenv:Header> <soapenv:Body> <wwex:quoteSpeedFreightShipment> <wwex:freightShipmentQuoteRequest> <wwex:insuranceDetail xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <wwex:senderState>AZ</wwex:senderState> <wwex:senderZip>85027</wwex:senderZip> <wwex:senderCountryCode>USA</wwex:senderCountryCode> <wwex:receiverState>NY</wwex:receiverState> <wwex:receiverZip>11428</wwex:receiverZip> <wwex:receiverCountryCode>USA</wwex:receiverCountryCode> <wwex:commdityDetails> <wwex:is11FeetShipment>N</wwex:is11FeetShipment> <wwex:handlingUnitDetails> <wwex:wsHandlingUnit> <wwex:typeOfHandlingUnit>Box</wwex:typeOfHandlingUnit> <wwex:numberOfHandlingUnit>1</wwex:numberOfHandlingUnit> <wwex:lineItemDetails> <wwex:wsLineItem> <wwex:lineItemHazmatInfo xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><wwex:lineItemClass>50</wwex:lineItemClass> <wwex:lineItemWeight>1</wwex:lineItemWeight> <wwex:lineItemDescription>Diamond Box</wwex:lineItemDescription> <wwex:lineItemPieceType>Pallet</wwex:lineItemPieceType> <wwex:piecesOfLineItem>1</wwex:piecesOfLineItem> </wwex:wsLineItem> </wwex:lineItemDetails> </wwex:wsHandlingUnit> </wwex:handlingUnitDetails> </wwex:commdityDetails> </wwex:freightShipmentQuoteRequest> </wwex:quoteSpeedFreightShipment> </soapenv:Body> </soapenv:Envelope>'; $header = arrays( "Content-type: text/xml;charset=\"utf-8\"", "Accept: text/xml", "Cache-Control: no-cache", "Pragma: no-cache", "SOAPAction: \"http://www.wwexship.com/webServices/services/SpeedFreightShipment\"", "Content-length: ".strlen($soap_request), ); $soap_do = curl_init(); curl_setopt($soap_do, CURLOPT_URL, $url); curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true ); curl_setopt($soap_do, CURLOPT_POST, true ); curl_setopt($soap_do, CURLOPT_POSTFIELDS, $soap_request); curl_setopt($soap_do, CURLOPT_HTTPHEADER, $header); $result = curl_exec($soap_do); echo "<pre>".$result."<pre>"; ?> 

===================================

Per ulteriore aiuto per favore torna @

http://www.linkedin.com/in/dramilmdodeja

Dramil Dodeja