Soap, send param
Hej EksperterJeg har kigget lidt på noget Soap, hvor jeg skal kommunikere med en server for at sende og hente nogle informationer.
Min kode er PT.
$client = new SoapClient('http://www.XXXX.dk:80/XXXX/XXXX?wsdl', array("trace" => 1, "exceptions" => 0));
$client->generateParcelLabel( 'authentication', new SoapParam('17', 'customerNo'), new SoapParam('demo', "password") );
$client->generateParcelLabel( 'authentication', new SoapParam('17', 'customerNo'), new SoapParam('demo', "password") );
Når den så sender denne funktion via Soap til serveren ser det således ud:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.post.dk/webpack2/parcellabel"><SOAP-ENV:Body><ns1:generateParcelLabel/><customerNo>17</customerNo><password>demo</password></SOAP-ENV:Body></SOAP-ENV:Envelope>[/div]
hvilket er rigtig godt, men....
Den mangler et parameter, så den skal se sådan her ud
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.post.dk/webpack2/parcellabel"><SOAP-ENV:Body><ns1:generateParcelLabel/><customerNo>17</customerNo><password>demo</password></SOAP-ENV:Body></SOAP-ENV:Envelope>[/div]
hvilket er rigtig godt, men....
Den mangler et parameter, så den skal se sådan her ud
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.post.dk/webpack2/parcellabel"><SOAP-ENV:Body><ns1:generateParcelLabel/><authentication><customerNo>17</customerNo><password>demo</password></authentication></SOAP-ENV:Body></SOAP-ENV:Envelope>[/div]
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.post.dk/webpack2/parcellabel"><SOAP-ENV:Body><ns1:generateParcelLabel/><authentication><customerNo>17</customerNo><password>demo</password></authentication></SOAP-ENV:Body></SOAP-ENV:Envelope>[/div]
Synes godt om
Vi tilbyder markedets bedste kurser inden for webudvikling