SOAP CLIENT and HEADER

SOAP CLIENT and HEADER

am 02.12.2009 02:08:42 von Augusto Flavio

hi All,



I'm trying to access a SOAP service but i have one doubt. I paste a
sample SOAP request for you know the problem:


//---------------- START SOAP REQUEST
POST /wbm/shopping/script/CalcPrecoPrazo.asmx HTTP/1.1
Host: shopping.correios.com.br
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/CalcPrecoPrazo" //NOTE THIS LINE


xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">


string
string
string
string
string
string
int
decimal
decimal
decimal
decimal
string
decimal
string



//---------------- END SOAP REQUEST




Ok. Now i'm creating the soap client:

$client = new SoapClient(null, array('location' =>
"http://shopping.correios.com.br/wbm/shopping/script/CalcPre coPrazo.asmx",
'uri' => "http://localhost/"));

//I need set the a header for this request: SOAPAction:
"http://tempuri.org/CalcPrecoPrazo", right?
How can i do it ?


I tried something like this but not worked.

$header = new SoapHeader('http://tempuri.org/CalcPrecoPrazo',
'SOAPAction',
null);

$client->__setSoapHeaders($header);


Someidea?

$results = $client->CalcPrecoPrazo($empresaCod, $empresaSenha,
$codigoFrete, $cepOrigem, $cepDestino, $peso,
(int)$formatoCd,
(int)$comprimento, (int)$altura, (int)$largura, (int)$VlDiametro,
$codMaoPropria,
(float)$valor, $codAvisoRecebimento);


thanks



Augusto Morais

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php