Re: [SOAP] SOAP client connecting to .net webservice
| From: | Heitor Machado | Date: | Mon, 27 Aug 2007 21:23:35 +0000 |
| Subject: | Re: [SOAP] SOAP client connecting to .net webservice | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-2613@lists.php.net to get a copy of this message | ||
Look at this:
http://www.php.net/manual/pt_BR/function.soap-soapclient-dorequest.php#74123
http://www.php.net/manual/pt_BR/function.soap-soapclient-dorequest.php#57995
regards
Heitor
On 8/27/07, Milo van der Linden <milo@3dsite.nl> wrote:
> Hello list!
>
> I am new to php SOAP and have an urgent question.
>
> I am trying to connect to a webservice that is written in ASP.net.
>
> The request I have to compose needs to be:
>
> <soapenv:Envelope
>
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:itw="http://www.itworks.nl/">
> <soapenv:Header>
> <itw:AuthenticationHeader>
> <itw:Username>milo</itw:Username>
> <itw:PasswordHash>111</itw:PasswordHash>
> <itw:Database>?</itw:Database>
> </itw:AuthenticationHeader>
> </soapenv:Header>
> <soapenv:Body>
> <itw:Hello>
> <itw:yourName>T. Estuser</itw:yourName>
> </itw:Hello>
> </soapenv:Body>
> </soapenv:Envelope>
>
> And up till now I have written the following code, it includes header
> authentication or is supposed to..:
>
> <?php
> error_reporting(E_ALL);
>
> $ini = ini_set("soap.wsdl_cache_enabled","0");
> $client = new
>
> SoapClient("http://10.0.0.56:81/wssoilution/wsSoilution.asmx?WSDL",
> array('location' =>
> 'http://10.0.0.56:81/wssoilution/wsSoilution.asmx',
> 'uri' => 'itw',
> 'trace' => 1));
>
>
> var_dump($client->__getFunctions());
> var_dump($client->__getTypes());
>
> $x["Username"]="milo";
> $x["PasswordHash"]="111";
> $x["Database"]="?";
>
> $x=new SoapVar($x,SOAP_ENC_OBJECT);
> $y["AuthenticationHeader"]=$x;
> $y=new SoapVar($y,SOAP_ENC_OBJECT);
>
> $header=new SoapHeader("",'AuthenticationHeader',$y);
> $client->__setSoapHeaders(array($header));
>
>
> $params2 = array('yourName'=> 'T.Estuser');
>
> $result2 = $client->Hello($params2);
>
> ?>
>
>
>
> The error I am recieving is: Fatal error SoapHeader:SoapHeader():
> Invalid parameters. Invalid namespace in soaptest.php on line 20
>
> I cannot figure out how to set the namespace parameters!
>
> Any help is appreciated.
>
> Kind regards!
>
> Milo
>
> --
> PHP Soap Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>