Recieving an array in VB.NET from a NuSOAP web service

2014-04-04
2014-06-12
  • Edit: Sorry can some one move this to the Help forum. That was pretty dumb.

    Hi,

    I have successfully managed to run many services from VB.NET, however I am unable return an array without the following error:

    "There is an error in XML document (1, x)."

    For the following three instances, I am able to get it working from php to php (NuSOAP), but from VB.NET to php(NuSOAP), it always returns the above error. These are the three examples.

    xsd:Array

    $server->wsdl->addComplexType(
    'ArrayOfString',
    'complexType',
    'array',
    'sequence',
    '',
    array(
    'itemName' => array(
    'name' => 'itemName',
    'type' => 'xsd:string',
    'minOccurs' => '0',
    'maxOccurs' => 'unbounded'
    )
    )
    );

    $server->wsdl->addComplexType(
    'Users',
    'complexType',
    'struct',
    'all',
    '',
    array( 'Users' => array('name' => 'UsersIn',
    'type' => 'xsd:Array'))
    );

    Due to the error I am unable to even return a base object. Is this a limitation, or is there something else I can do? Thanks

     
    Last edit: Nathan Williams 2014-04-04
  • Andrew Nagle
    Andrew Nagle
    2014-06-12

    I don't know if you ever got this working, but this is how I declared my complex types.

    <?php
    $server->wsdl->addComplexType(
        'UserDetail',
        'complexType',
        'struct',
        'sequence',
        '',
        array(
            'username' => array(
                'type' => 'xsd:string'
            ),
            'displayName' => array(
                'type' => 'xsd:string'
            )
        )
    );
    
    $server->wsdl->addComplexType(
        'ArrayOfUserDetail',
        'complexType',
        'array',
        '',
        'SOAP-ENC:Array',
        array(),
        array(
            array(
                'ref' => 'SOAP-ENC:arrayType',
                'wsdl:arrayType' => 'tns:UserDetail[]'
            )
        ),
        'tns:UserDetail'
    );
    ?>
    

    I'm using this with C# instead of VB, but it shouldn't make much of a difference.

    Edit: typo

     
    Last edit: Andrew Nagle 2014-06-12