Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I understand that I need to pass the parameters of the function as the index of an array. I also understand that the values of the parameter are the corresponding values of that index of the array. But I cannot get my function to work. I pass the variable into the function in the WSDL but I am not getting anything.

Here is my PHP code:

try{
    $soap_client = new SoapClient("https://foo.example.com:8443/current/bar?wsdl");
    $log_in = array(
        "iwsUsername"    => "username", 
        "iwsSecretKey"   => "secretKey",
        "caller"         => "JohnDoe", 
        "callerPassword" => "password"
    );
    //passing values into the function parameters above
    $request = $soap_client->authenticatedPing($log_in);
    echo $request->authenticatedPing;
} catch(SoapFault $exception){
    echo '?????';
}

These are obviously fake values for security purposes but you get the idea.

Here is the WSDL for this function:

 <wsdl:operation name="authenticatedPing">
   <soap12:operation soapAction="" style="rpc"/>
   <wsdl:input name="authenticatedPing">
     <soap12:body namespace="http://www.example.com" use="literal"/>
   </wsdl:input>
   <wsdl:output name="authenticatedPingResponse">
     <soap12:body namespace="http://www.example.com" use="literal"/>
   </wsdl:output>

What am I doing wrong?

share|improve this question
    
Apart from hovering over the icons in the wysiwyg editor when writing the question, you can check out stackoverflow.com/editing-help to learn how to format posts with markdown. On a side note: you said SO is a forum. It's not. It's a Q&A site and it works very differently than a forum.. For example, we don't have threads. –  Gordon Jul 19 '13 at 16:49
    
"What am I doing wrong?" - I think what you're first of all doing wrong is not looking for the concrete error message. Which message does the Exception have? You only echo some text but not the exception message (php.net/exception.getmessage). Please provide it with your question. –  hakre Jul 21 '13 at 9:31

2 Answers 2

the following are just some comments - not an answer - to differentiate the conclusions you draw in your question so for (so this is not totally helpful just pointing out some weak spots, I know that we don't have SOAP well covered on this one on Stackoverflow, but we have it covered at least somehow)

I understand that I need to pass the parameters of the function as the index of an array.

No, this is actually not the case. Next to arrays you can also parse objects and even meta-objects. The array notation is only there for short-cutting some of these and it follows somewhat obscure rules that are not really clearly documented.

To give you an example: Please provide reference for your array statement. Provide a link where it is documented when, how and why the array has to be created the way you did.

I also understand that the values of the parameter are the corresponding values of that index of the array.

Again, even this statement is not overly wrong, you didn't outline why in this case and following which rules.

I pass the variable into the function in the WSDL but I am not getting anything.

You get something. Find out more exactly what. What is the exception message for example.

share|improve this answer
up vote 0 down vote accepted

The non-WSDL form worked. Thank you for your comments

$client = new SoapClient(null, array('location' => "https://************.com:*******/*****-=/iws", 'soap_version' => SOAP_1_2, 'uri' => 'http://www.*******.com', 'style' => SOAP_RPC, 'use' => SOAP_LITERAL));
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.