irwallace 0 Newbie Poster

Hi Guys,

I was hoping someone could point me in the right direction. I have a nusoap server that I am trying to pass an array of data to. For now I just want to simply pass this array back, before handling this data, mainly to help my learning process. The problem in when I pass the data I get this error message:

    [faultcode] => SOAP-ENV:Server
    [faultactor] =>
    [faultstring] => unable to serialize result
    [detail] =>

The following code is my nusoap server

    // Create the server instance
    $server = new soap_server;
    $server->debug_flag = false;
    $server->configureWSDL('SyncroWebService', $namespace);
    $server->wsdl->schemaTargetNamespace = $namespace;
    //Create complex type for addProduct
            array ( 'rmsId' => array('Name' => 'rmsId', 'type' => 'xsd:string'),
                    'departmentName' => array ('Name' => 'departmentName', 'type' => 'xsd:string'),
                    'categoryName' => array('Name' => 'categoryName', 'type' => 'xsd:string'),
                    'productName' => array('Name' => 'productName', 'type' => 'xsd:string'),
                    'productPrice' => array('Name' => 'productPrice', 'type' => 'xsd:float'),
                    'productQty' => array('Name' => 'productQty', 'type' => 'xsd:int'))
            array('addProductRequest' =>array('name'=>'addProductRequest', 'type'=>'tns:addProductRequestArray'))
            // Register the method to expose
    $server->register('addNewProduct', array('productName'=>'xsd:string'), array('return'=>'tsn:addProductResponce'), $nameSpace);
    // Define the method as a PHP function
    function addNewProduct($newProductDetails) {

    // Use the request to (try to) invoke the service

The data that I am passing from my client is the following -

$params = array(
        'rmsId' => '123456789',
        'departmentName' => 'Britax',
        'categoryName' => 'Car Seat',
        'productName' => 'test Product For Britax Car Seat',
        'productPrice' => 33.99,
        'productQty' => 10
    $result = $client->call('addNewProduct', $params);

Any help would be greatly appreciated!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.