Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Set Complex Types As Input parameter

Help
Anonymous
2012-09-19
2013-06-06

  • Anonymous
    2012-09-19

    Hi,
    i'm not new to Nusoap but now i have a problem with the input parameters

    In need to register a complex Type to the Inputparameter

    Example:

    $input = array(
      'user'=> 'username',
      'pass' => 'Password',
      'change'=> array(
        array(
            'kunden_id'=>0,
            'kunden_nr'=> 15
        ),
        array(
            'kunden_id'=>1,
            'kunden_nr'=> 16
        ),
        array(
            'kunden_id'=>0,
            'kunden_nr'=> 17
        ),
    )
    );

    My problem: The part user and pass will be in all requestes , but the array change could have a count between 0 and xxxxxx

    my registerfunction

            $this->nusoap_server->wsdl->addComplexType('OSCAPI_SetKundenNrToKundenIdInputModel','element','struct','all','',array("kunden_id" => array('name' => "kunden_id", 'type' => 'xsd:int'),"kunden_nr" => array('name' => "kunden_nr", 'type' => 'xsd:string')));
            $this->nusoap_server->wsdl->addComplexType('OSCAPI_SetKundenNrToKundenIdInputArray','complexType','array','','SOAP-ENC:Array',array(),array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:OSCAPI_SetKundenNrToKundenIdInputModel[]')),'tns:OSCAPI_SetKundenNrToKundenIdInputModel');
            $this->complex('OSCAPI_SetKundenNrToKundenIdInput',array("id"=>array('name'=>'id','type'=>'tns:OSCAPI_SetKundenNrToKundenIdInputArray')));
            $this->complex('OSCAPI_SetKundenNrToKundenIdReturn',array("Erfolgreich"=> array('name'=>'Erfolgreich','type'=>'xsd:boolean'),"Fehler"=>array('name'=>'Fehler','type'=>'xsd:string')));            
            $this->nusoap_server->register("OSCAPI_SetKundenNrToKundenId",
                array('user'=>'xsd:string','pass'=>'xsd:string','ids'=> 'tns:OSCAPI_SetKundenNrToKundenIdInput'),
                array("return"=>"tns:OSCAPI_SetKundenNrToKundenIdReturn"),
                "urn:OSCAPI",
                "urn:OSCAPI#OSCAPI_SetKundenNrToKundenId",
                "rpc",
                "encoded",
                "");
    

    But if we call this , the function only receive an array like this

      ["id"]=>
      array(3) {
        [0]=>
        string(1) "1"
        [1]=>
        string(2) "22"
        [2]=>
        array(2) {
          [0]=>
          string(1) "2"
          [1]=>
          string(1) "5"
        }
      }
    

    whats the errors?

     

  • Anonymous
    2012-09-19

    i forget the model

    $this->nusoap_server->wsdl->addComplexType(
    'OSCAPI_SetKundenNrToKundenIdInputModel',
    'element',
    'struct',
    'all',
    '',
    array(
    "kunden_id" => array('name' => "kunden_id", 'type' => 'xsd:int'),
    "kunden_nr" => array('name' => "kunden_nr", 'type' => 'xsd:string')
    )
    );