Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

client call problems

Help
Cronet
2010-01-29
2013-06-06
  • Cronet
    Cronet
    2010-01-29

    Hey,

    I'm very new to nusoap and soap in general.

    I try to create a simple client, according to the examples

       $options = array('key1'=>'var1', 'key2'=>'var2');
       $client = new nusoap_client('http://xxx.xx/V2_7/WebService.asmx?WSDL', true);
       
       // $result = $client->call('GetLocation', $options);
       $result = $client->call('GetLocation', $options, 'http://xxx.xx/V2_7');
    

    The problem here is, that nusoap don't add the array $options to my request and I don't know why!

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns3993="http://xxx.xx/V2_7">
        <SOAP-ENV:Body>
            <getLocation xmlns="http://xxx.xx/V2_7"/>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    

    I see nothing in the debug log what point to a problem!

    2010-01-29 03:45:31.198647 wsdl: have 1 part(s) to serialize using document/literal
    2010-01-29 03:45:31.198802 wsdl: have 2 parameter(s) provided as arrayStruct to serialize
    2010-01-29 03:45:31.198943 wsdl: check whether the caller has wrapped the parameters
    2010-01-29 03:45:31.199083 wsdl: check whether caller's parameters match the wrapped ones
    2010-01-29 03:45:31.199228 wsdl: in parametersMatchWrapped type=http://xxx.xx/V2_7:getLocation, parameters=
    array(5) {
      ["key1"]=>
      string(4) "val1"
      ["key2"]=>
      string(4) "val2"
    }
    2010-01-29 03:45:31.199404 wsdl: in parametersMatchWrapped: got a prefixed type: getLocation^, http://xxx.xx/V2_7
    2010-01-29 03:45:31.199550 wsdl: in getTypeDef: type=getLocation^, ns=http://xxx.xx/V2_7
    2010-01-29 03:45:31.199694 wsdl: in getTypeDef: have schema for namespace http://xxx.xx/V2_7
    

    Calls wher no params are needed are working fine!

    What causes the loose of the parameters?
    Is there something according to the namespace? Or do i need to set a prefix or something manually?

    I don't get the clue how to get this work. Hope you can help me!

    Regards,
    Cronet

     
  • Scott Nichol
    Scott Nichol
    2010-04-26

    A little more from the debug log would have helped, but it seems likely that you are calling a .NET service that has "wrapped" its parameters.  NuSOAP tries to detect this auto-magically, but it sound likes it is failing in your case.  That's where the debug would be nice.

    You can also try to manually wrap.  In this case something like

    $result = $client->call('GetLocation', array('parameters' => $options));

    might do the trick.