NuSOAP Call with identical indexes

Help
IPFox
2010-02-16
2013-06-06
  • IPFox

    IPFox - 2010-02-16

    Hi,

    I have WSDL webservice made available for me and I'm usually using nuSoap to utilize these on PHP. However now there is situation where the WSDL has a part where there is two(or more) parameters with name int in systemsSelected section.

    #WSDL
    <web:systemsSelected>
    <web:int>?</web:int>          
    <web:int>?</web:int>
    </web:systemsSelected>
    #PHP nusoap
    'systemsSelected' => array('int' => $param1, 'int' => $param2)
    

    So in  nuSoap this would be done with array, but in PHP arrays cannot have identical indexes.
    #PHP 2nd try has the ways I have tried to solve this.

    #PHP 2nd try
    $system= array('int' => array($param1,$param2));
    $package['int'] = array($param1, $param2);
    

    Any ideas how I can utilize that webservice?
    Doesn't have to be with nuSoap, but PHP is needed.

    Thanks before hand

     
  • IPFox

    IPFox - 2010-02-16

    For some reason that my first post exploded…The section below the first code block should be:

    So in nuSoap this would be done with array, but in PHP arrays cannot have identical indexes.
    #PHP 2nd try has the ways I have tried to solve this.

     $system= array('int' => array($param1,$param2)); 
    $package = array($param1, $param2);
    
     
  • Moiz S

    Moiz S - 2010-02-16

    I have the same problem and need a solution !!

     
  • IPFox

    IPFox - 2010-02-17

    This is what I have found, and this solves the problem (http://users.skynet.be/pascalbotte/rcx-ws-doc/nusoapadvanced.htm).

        require_once('nusoap.php');
            // define the soapaction as found in the wsdl
            $soapaction = "http://www.infobel.com/WebService/Search";
            // endpoint address
        $wsdl = "http://hal.kapitol.com/infobelservices/service1.asmx";
        $namespace = "http://www.infobel.com/WebService/";
        $client = new soapclient($wsdl);
            // you will find the serializeEnvelope() prototype by making a search in nusoap.php
        $mysoapmsg = $client->serializeEnvelope('<Search xmlns="http://www.infobel.com/WebService/"><inputQuery>
        <login>infobel</login>
        <password>test</password>
        <country>aeCountryBE</country>
        <service>aeSrvStandard</service>
        <Name>durand</Name>
        <City>bruxelles</City>
        <Zip></Zip>
        <XCoord>0</XCoord>
        <YCoord>0</YCoord>
        <Range>0</Range>
        <PageStep>5</PageStep>
        <Language>aeLangFrench</Language>
        <CoordType>aeCTWGS</CoordType>
        </inputQuery></Search>','',array(),'document', 'literal');
        /* Send the SOAP message and specify the soapaction  */
        $response = $client->send($mysoapmsg, $soapaction);
    
     
  • Scott Nichol

    Scott Nichol - 2010-04-26

    $system= array('int' => array($param1,$param2));

    This should have done what you are trying.

     
  • Scott Nichol

    Scott Nichol - 2010-04-26

    To elaborate on my previous post, it should work if you are using WSDL in the NuSOAP client, e.g. you do

    $client = new nusoap_client($wsdl_url, 'wsdl');

     
  • JoeyRiso

    JoeyRiso - 2011-09-10

    I have a similar problem. The WSDL specifies a number of nested arrays of complex types, several of which may be, and in many cases, must be, repeated. When I attempt this, only the last one survives. There is no accommodation in the WSDL for an index in the arrays.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks