Folks,
Am new to use webservice in PHP and when I call __soapCall () function always returns a value to me as if he had not passed the username and password . But when I put the information in SOAPUI works, what am I doing wrong ??? how do I get the correct return PHP ? I think the code that understand how you had not managed to pass the parameter …
XML
[php]<s:schema elementFormDefault=“qualified” targetNamespace=“http://www.exemplo.com.br/ws”>
<s:element name=“AutenticarUsuario”>
<s:complexType/>
</s:element>
<s:element name=“AutenticarUsuarioResponse”>
<s:complexType>
<s:sequence>
<s:element minOccurs=“0” maxOccurs=“1” name=“AutenticarUsuarioResult” type=“s:string”/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name=“AutenticacaoHeader” type=“tns:AutenticacaoHeader”/>
<s:complexType name=“AutenticacaoHeader”>
<s:sequence>
<s:element minOccurs=“0” maxOccurs=“1” name=“User” type=“s:string”/>
<s:element minOccurs=“0” maxOccurs=“1” name=“Password” type=“s:string”/>
<s:element minOccurs=“0” maxOccurs=“1” name=“TokenAutenticado” type=“s:string”/>
<s:element minOccurs=“0” maxOccurs=“1” name=“Email” type=“s:string”/>
</s:sequence>
<s:anyAttribute/>
</s:complexType>
[/php]PHP
[php]$client = new SoapClient(“http://www.phphelp.com/PoweredBy/PoweredByWebService.asmx?WSDL”);
$params = new StdClass();
$params = array( “User”=>"‘fabio’",
“Password”=>"‘123456’",
“Email”=>"‘[email protected]’");
$result = $client->__soapCall(“AutenticarUsuario”, $params);
print_r($result);
[/php]Retorno PHP
stdClass Object ( [AutenticarUsuarioResult] => wrong password or user invalid!!! )
SOAP Request
[php]<soap:Envelope xmlns:soap=“http://www.w3.org/2003/05/soap-envelope” xmlns:ws=“http://www.phphelp.com/ws”>
soap:Header
ws:AutenticacaoHeader
ws:Userfabio</ws:User>
ws:Password123456</ws:Password>
ws:Emailfabio[member=4121]phphelp[/member].com</ws:Email>
</ws:AutenticacaoHeader>
</soap:Header>
soap:Body
ws:AutenticarUsuario/
</soap:Body>
</soap:Envelope>
[/php]SOAP Result
[php]<soap:Envelope xmlns:soap=“http://www.w3.org/2003/05/soap-envelope” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=“http://www.w3.org/2001/XMLSchema”>
soap:Body
d2149dc5-ce6f-472d-9a83-b950ce3c3f27
</soap:Body>
</soap:Envelope>[/php]