Hi all,

i'm trying to connect to a SOAP Server but i'm having a problem. Look
the xml that i need send to the server:

// THIS IS THE XML CORRECT THAT NEED BE SENT TO THE SERVER

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
<soap:Body>
<CalcPrecoPrazo xmlns="http://tempuri.org/";>
        <nCdEmpresa>XXXXX</nCdEmpresa>
        <sDsSenha>XXXXXX</sDsSenha>
        <nCdServico>40010</nCdServico>
        <sCepOrigem>30840300</sCepOrigem>
        <sCepDestino>30840280</sCepDestino>
        <nVlPeso>10</nVlPeso>
        <nCdFormato>1</nCdFormato>
        <nVlComprimento>20</nVlComprimento>
        <nVlAltura>5</nVlAltura>
        <nVlLargura>10</nVlLargura
        ><nVlDiametro>0</nVlDiametro>
        <sCdMaoPropria>S</sCdMaoPropria>
        <nVlValorDeclarado>300</nVlValorDeclarado>
        <sCdAvisoRecebimento>S</sCdAvisoRecebimento>
</CalcPrecoPrazo>
</soap:Body>
</soap:Envelope>


And now the xml that i'm sending to the SOAP Server.


//THIS IS THE XML THAT THE PHP IS SENDING
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="http://tempuri.org/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
<SOAP-ENV:Body>
<ns1:CalcPrecoPrazo> // HOW CAN I REMOVE THIS NAMESPACE? ns1:
        <nCdEmpresa xsi:type="xsd:int">XXXXX</nCdEmpresa>
        <sDsSenha xsi:type="xsd:string">XXXXXX</sDsSenha>
        <nCdServico xsi:type="xsd:string">40096</nCdServico>
        <sCepOrigem xsi:type="xsd:string">30840280</sCepOrigem>
        <sCepDestino xsi:type="xsd:string">30840300</sCepDestino>
        <nVlPeso xsi:type="xsd:string">10</nVlPeso>
        <nCdFormato xsi:type="xsd:string">1</nCdFormato>
        <nVlComprimento xsi:type="xsd:string">5</nVlComprimento>
        <nVlAltura xsi:type="xsd:string">10</nVlAltura>
        <nVlLargura xsi:type="xsd:string">0</nVlLargura>
        <nVlDiametro xsi:type="xsd:string">300</nVlDiametro>
        <sCdMaoPropria xsi:type="xsd:string">N</sCdMaoPropria>
        <nVlValorDeclarado xsi:type="xsd:string">300</nVlValorDeclarado>
        <sCdAvisoRecebimento xsi:type="xsd:string">N</sCdAvisoRecebimento>
        </ns1:CalcPrecoPrazo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


How can i remove the ns1 from the Child CalcPrecoPrazo?

Some idea?



//here is the php code:

$client = new SoapClient(null, array('location' => $url,
                                     'uri'      =>
"http://tempuri.org/CalcPrecoPrazo";,
                                     'trace'    => 1 ));

$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

Reply via email to