0

I am new to SOAP and tryign to call webservice which is hosted on somewhereelse.

I am trying to call "IsUniqueUser" webservice which check whether the user is unique or not.

Following is schema for service..

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ser="some service" xmlns:xsd="some xsd" xmlns:xsd1="">
 <soap:Header/>
 <soap:Body>
  <ser:isUniqueUser>
     <!--Optional:-->
     <ser:request>
    <xsd:userName>SomeValidUserName</xsd:userName>
 </ser:request>
 </ser:isUniqueUser>
 </soap:Body>
 </soap:Envelope>

And i am trying to invoke this xervice in php using following code

  $client = new SoapClient('Some.wsdl');

And after http authentication i am trying to call the isUniqueUser Method and passed "userName" as parameter.

 $unique = $client->__soapCall('isUniqueUser',  array('userName' =>'vish123'));

But nothing work out and i am getting following error

 stdClass Object
 (
[return] => stdClass Object
    (
        [errorCode] => 11ARPMWS1004
        [errorMessage] => null. null
        [status] => Failure
        [uniqueUser] => 
    )

)

I ahve tried to pass parameter in many ways like

    $params = array('UserName' =>$_POST['userName']);
    $unique = $client->__soapCall("isUniqueUser", $params);

OR

    $unique = $client->isUniqueUser($params);

OR

     $unique = $client->_soapCall('isUniqueUser', array('paramaters'=>$params));

OR

       $unique = $client->_soapCall('isUniqueUser', array('request'=>$params));

And still i am getting the same error. I have contacted with provider for this issue and they said there is something wrong with code while passing the parameter.

Can anyone please let me know how to fix this issue?

Thanks

0

4 Answers 4

1

What I can see from you request is you have xsd:userName node under "ser:request", Can you try with creating array of request having array of userName.

$params = array('UserName' =>$_POST['userName']);
$paramsrequest = array('request' =>$param);
$unique = $client->__soapCall("isUniqueUser",$paramsrequest);
Sign up to request clarification or add additional context in comments.

Comments

0

see if this helps:

<?php
    $sClient = new SoapClient('Some.wsdl');
    $wrapper = null;
    $wrapper->isUniqueUser->request->userName = new SoapVar('SomeValidUserName', XSD_STRING);
    $result = $sClient->isUniqueUser($wrapper);
    echo $sClient->__getLastResponse();
?>

Also, have you tried to fire manually using some soap client like soapUI? is it working?

1 Comment

it does not work at all. Though i have not tested it manually but our provider says that they can invoke this service by using Soap Client tool.any other ideas?
0

In one of my project I use this :

    $soapClient = new SoapClient($wsdl,$params);
    $reponseclient=$soapClient->authentification($username,$password);
    if($reponseclient->demandeRealisee===false){
         error_log("Couldn't log ".$username);
    }

Comments

0

I had the same problem. I tried everything you did.

This one solved for me:

$result = $soapClient->somefunction(array(
    "param1" => "value1",
    "param2" => "value2"
));

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.