tags:

views:

49

answers:

0

Hi, I have problem with array in nuSoap. This is my simple WebService:

require_once("lib/nusoap.php");
$namespace = "http://localhost/test/";
// create a new soap server
$server = new soap_server();
// configure our WSDL
$server->configureWSDL("SimpleService");
// set our namespace
$server->wsdl->schemaTargetNamespace = $namespace;
$server->wsdl->addComplexType(
  'ArrayOfString',
  'complexType',
  'array',
  'sequence',
  '',
  array(
    'itemName' => array(
      'name' => 'itemName', 
      'type' => 'xsd:string'
    )
  )
);
function ProcessSimpleType($who) {
    $array[] =$who."first";
    $array[] =$who."second";    
    return $array;
}
// register our WebMethod
$server->register(
                // method name:
                'ProcessSimpleType',         
                // parameter list:
                array('name'=>'xsd:string'), 
                // return value(s):
                array('return'=>'xsd:ArrayOfString'),
                // namespace:
                $namespace,
                // soapaction: (use default)
                false,
                // style: rpc or document
                'rpc',
                // use: encoded or literal
                'encoded',
                // description: documentation for the method
                'A simple Hello World web method');               
// Get our posted data if the service is being consumed
// otherwise leave this data blank.                
$POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA']) 
                ? $GLOBALS['HTTP_RAW_POST_DATA'] : '';
// pass our posted data (or nothing) to the soap service                    
$server->service($POST_DATA);                
exit();

And C# code

WebService.SimpleService svc = new WebService.SimpleService();
svc.ProcessSimpleType("Test"); //in this line I have exception "Document XML contains error (1, 483)"

I suppose that is the problem with types.