eZ Community » Forums » Extensions » ggwebservices Soap webservice in wsdl...
expandshrink

ggwebservices Soap webservice in wsdl mode

ggwebservices Soap webservice in wsdl mode

Friday 24 February 2012 6:04:26 pm - 6 replies

The method call of soap webservice (.net) with wsdl mode receive always errors for malformed message.

The problem is that the envelope xml message created is not correct.
Is malformed.  The problem seems the call to __soapCall. From Php
documentation this function should be used only for non wsdl mode.
For wsdl mode should be executed the method call of the webservice
like "soap_client object"->"webservice method".

To work around we have add this test in ggphpsoapclient.php, send function:

        if ( $this->Wsdl == null )
            $results = $client->__soapCall( $rname, $request->parameters(), array(), array(), $output_headers );
        else
            $results = $client->$rname($request->parameters());

Now the client service work without problem.The problem is also reproducible in "wss debugger"

Other have had same problem ?

May be a bug or we have did something wrong on call functions ?

 

Best regards Pat

Modified on Tuesday 28 February 2012 12:46:15 pm by Antonio Patarozzi

Sunday 26 February 2012 5:11:55 pm

Hello Antonio.

This is the first time that someone reports this bug - but other bugs have been fixed with the extension and SOAP, even in the most recent versions.

1. are you using the latest version of the extension? (0.11.2)

2. are you using soap 1.1 or 1.2?

3. is your soap server accessible to the public so that I can test it?

4. can you show me the php/tpl code that you use for making the call?

5. can you also paste the output of the debugger (complete http request and response for both the correct and incorrect calls)

Monday 27 February 2012 11:56:23 am

Hello Gaetano and thank for your reply.

I'll answer to your question:

  1. We are using the latest version. 0.11.2
    1. In php script we have used soap 1.1. With wss debugger we have test also with soap1.2 but the result is HTTP/1.1 415 Cannot process the message because the content type 'application/soap+xml' was not the expected type 'text/xml; charset=utf-8'..
  2. Server is accessibile in vpn and is not accessibile from public.
  3. Php code:<pre>
    <?php
    /**
     * Sample soap client that uses the ggws classes outside of an eZ Publish context
     * The server endpoint in use is the public one from mssoapinterop.org
     *
     * @version $Id: soap_client_outside_ezp.php 420 2012-01-11 08:41:39Z gg $
     * @author Gaetano Giunta
     * @copyright (c) 2010-2012 G. Giunta
     * @license code licensed under the GNU GPL. See LICENSE file
     */

    require 'autoload.php';

    // create a new client
    $client = new ggPhpSOAPClient( "http://address", "/location/Service.svc?wsdl", 80, null, 'http://address/location/Service.svc?wsdl' );

    // define the request
    $request = new ggPhpSOAPRequest( "GetData", array('var1'=>'BBBPPO','var2'=>'08998') );

    // set client to debug mode
    $client->setOption( 'debug', 2 );

    // send the request to the server and fetch the response
    $response = $client->send( $request );
    // show debug info
    echo 'SENT:  <div style="background-color: silver">' . htmlspecialchars( $client->RequestPayload() ) . "</div>";
    echo 'RECEIVED: <div style="background-color: silver">' . htmlspecialchars( $client->ResponsePayload() ) . "</div>";

    // check if the server returned a fault, if not print out the result
    if ( $response->isFault() )
    {
        print( "Fault: " . $response->faultCode(). " - \"" . $response->faultString() . "\"" );
    }
    else
    {
        print_r( "Returned value was: \"" . $response->value() . "\"" );
    }

    ?>

Modified on Wednesday 29 February 2012 3:58:53 pm by Antonio Patarozzi

Tuesday 28 February 2012 10:58:31 am

Ok, I see that the 1st request is quite wrong - despite the forum's having mangled the xml a bit... blunk.gif Emoticon

1. can you send me all of this via mail at g g at e z dot n o ?

2. can you also put in the mail the wsdl file you get from the .net server? This way I can run some tests on localhost

3. you have twice the "abi" value in your input parameters. Not a deadly sin...

4. can you test the call by using $request = new ggPhpSOAPRequest( "GetData", array( array('uid'=>'ASSPPO','abi'=>'08852') ) );

Tuesday 28 February 2012 12:44:22 pm

Hi Gaetano,

 

I have tested the call with your suggest:

$request = new ggPhpSOAPRequest( "GetData", array( array('var1'=>'BBBPPO','var2'=>'08992') ) );

With this call the call to webservice its ok.

To pass parameters i need always to specify array of array ?

To test with ws debug, in admin interface, how can specify array of array ?

You always need wsdl file ?

Best regards

Pat

 

Modified on Wednesday 29 February 2012 3:57:29 pm by Antonio Patarozzi

Tuesday 28 February 2012 6:19:04 pm

1. To pass parameters do you always need array of array? No idea. I generally always have to play around a little bit until I get the call right, when using soap+wsdl. It never occurred to me to try your solution, which is in fact more elegant than the double array. But if using double array works, I'm hesitant to change the extension, as it will possibly break for existing users...

2. The debugger uses a json format to represent data. Just type in the textarea something like this: [ { "uid":2, "val", 5 } ]

3. I don't need the wsdl anymore, if your problem is solved

ciao

Gaetano

Thursday 01 March 2012 10:18:58 am

1. To pass parameters do you always need array of array? No idea. I generally always have to play around a little bit until I get the call right, when using soap+wsdl. It never occurred to me to try your solution, which is in fact more elegant than the double array. But if using double array works, I'm hesitant to change the extension, as it will possibly break for existing users...

2. The debugger uses a json format to represent data. Just type in the textarea something like this: [ { "uid":2, "val", 5 } ]

3. I don't need the wsdl anymore, if your problem is solved

ciao

Gaetano

1. I agree with you. It 's better to keep backwards compatibility.

Only the last question. It's only to understand better. It may be that the method of passing parameters (with or without arrary of array) depends on the content of the wsdl file?

if so, the function __soapCall is wrong to create the message because it is based on the wsdl file, and that somehow it must extract?

Thanks again for help, "grazie mille".

Best regards,

Pat

Modified on Thursday 01 March 2012 10:32:24 am by Antonio Patarozzi

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from