You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Pete Robbins <ro...@googlemail.com> on 2006/04/13 13:24:24 UTC

[Axis2C] Setting SoapAction and SOAP version in a client

How do I do this?

I tried using axis2_stub and this allowed me to use
AXIS2_STUB_SET_SOAP_VERSION but I can't find a way to set the SOAPAction.

So I chenged to use axis2_mep_client which allows me to use
AXIS2_MEP_CLIENT_SET_SOAP_ACTION but I can't find a way to set the SOAP
version! I tried using AXIS2_MEP_CLIENT_SET_SOAP_VERSION_URI but when I call
AXIS2_MEP_CLIENT_PREPARE_SOAP_ENVELOPE it always uses SOAP12 :-(

--
Pete

Re: [Axis2C] Setting SoapAction and SOAP version in a client

Posted by Pete Robbins <ro...@googlemail.com>.
On 13/04/06, Samisa Abeysinghe <sa...@gmail.com> wrote:
>
> I have fixed the problem and posted the latest source package at
> http://people.apache.org/~samisa/
> Please have a look.
>
> Samisa...



That does the trick! Thank you.

--
> Pete

Re: [Axis2C] Setting SoapAction and SOAP version in a client

Posted by Samisa Abeysinghe <sa...@gmail.com>.
I have fixed the problem and posted the latest source package at 
http://people.apache.org/~samisa/
Please have a look.

Samisa...

Pete Robbins wrote:

>
>
> On 13/04/06, *Samisa Abeysinghe* <samisa.abeysinghe@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     Hi Pete,
>        You are correct, there seems to be a bug here; the API is supposed
>     to be such that you can call AXIS2_MEP_CLIENT_PREPARE_SOAP_ENVELOPE,
>     then get the soap envelope though the message context returned by that
>     call and set the SOAP version on that soap envelope. However, the
>     logic
>     in set SOAP version method of SOAP envelope seem to be commented
>     out, I
>     am not sure why, have to dig into the cuase to find out why.
>        Please raise a Jira on this.
>
>  
> I think the problem is in mep_client. The 
> axis2_mep_client_prepare_soap_envelope creates a msg_ctx which will 
> always have the default isSoap11 set to false. This flag is then used 
> to call axis2_soap_envelope_create_default_soap_envelope.
>  
> Rather than checking AXIS2_MSG_CTX_GET_IS_SOAP_11, which will always 
> be false, the code could use the value set by 
> AXIS2_MEP_CLIENT_SET_SOAP_VERSION_URI to determine the call to 
> axis2_soap_envelope_create_default_soap_envelope??
> Cheers,
>
> -- 
> Pete



Re: [Axis2C] Setting SoapAction and SOAP version in a client

Posted by Samisa Abeysinghe <sa...@gmail.com>.
Pete Robbins wrote:

>
>
> On 13/04/06, *Samisa Abeysinghe* <samisa.abeysinghe@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     Hi Pete,
>        You are correct, there seems to be a bug here; the API is supposed
>     to be such that you can call AXIS2_MEP_CLIENT_PREPARE_SOAP_ENVELOPE,
>     then get the soap envelope though the message context returned by that
>     call and set the SOAP version on that soap envelope. However, the
>     logic
>     in set SOAP version method of SOAP envelope seem to be commented
>     out, I
>     am not sure why, have to dig into the cuase to find out why.
>        Please raise a Jira on this.
>
>  
> I think the problem is in mep_client. The 
> axis2_mep_client_prepare_soap_envelope creates a msg_ctx which will 
> always have the default isSoap11 set to false. This flag is then used 
> to call axis2_soap_envelope_create_default_soap_envelope.
>  
> Rather than checking AXIS2_MSG_CTX_GET_IS_SOAP_11, which will always 
> be false, the code could use the value set by 
> AXIS2_MEP_CLIENT_SET_SOAP_VERSION_URI to determine the call to 
> axis2_soap_envelope_create_default_soap_envelope??
> Cheers,

Yes you are correct, we could fix it that way. Thanks for the suggestion.
I also think we should fix the soap_envelope struct implementation as well.

Samisa...

>
> -- 
> Pete



Re: [Axis2] SOAP 1.2 broken

Posted by Samisa Abeysinghe <sa...@gmail.com>.
I fixed this.
Samisa...

Samisa Abeysinghe wrote:

> Jira is down at the moment, hence the mail.
>
> SOAP 1.2 seem to be broken, I was wondering why addressing interop 
> tests were failing and found that there is something wrong in the 
> message.
>
> I captured the message and the HTTP headers read as follows:
>
> POST /axis2/services/echo HTTP/1.1
> User-Agent: Axis2/C
> SOAPAction: http://ws.apache.org/axis2/c/samples/echoString
> Content-Length: 482
> Content-Type: application/soap+xml
> Host: localhost:9090
>
>
> We send the SOAPAction seperatelly, whereas we should have sent:
>
> Content-Type: 
> application/soap+xml;charset=UTF-8;action="http://example.org/action/echoIn"; 
>
>
> We had the correct implementation but some or the other fix down the 
> line must have broken this :(
>
> Samisa...
>
>


[Axis2] SOAP 1.2 broken

Posted by Samisa Abeysinghe <sa...@gmail.com>.
Jira is down at the moment, hence the mail.

SOAP 1.2 seem to be broken, I was wondering why addressing interop tests 
were failing and found that there is something wrong in the message.

I captured the message and the HTTP headers read as follows:

POST /axis2/services/echo HTTP/1.1
User-Agent: Axis2/C
SOAPAction: http://ws.apache.org/axis2/c/samples/echoString
Content-Length: 482
Content-Type: application/soap+xml
Host: localhost:9090
 

We send the SOAPAction seperatelly, whereas we should have sent:

Content-Type: application/soap+xml;charset=UTF-8;action="http://example.org/action/echoIn";

We had the correct implementation but some or the other fix down the 
line must have broken this :(

Samisa...


Re: [Axis2C] Setting SoapAction and SOAP version in a client

Posted by Pete Robbins <ro...@googlemail.com>.
On 13/04/06, Samisa Abeysinghe <sa...@gmail.com> wrote:
>
> Hi Pete,
>    You are correct, there seems to be a bug here; the API is supposed
> to be such that you can call AXIS2_MEP_CLIENT_PREPARE_SOAP_ENVELOPE,
> then get the soap envelope though the message context returned by that
> call and set the SOAP version on that soap envelope. However, the logic
> in set SOAP version method of SOAP envelope seem to be commented out, I
> am not sure why, have to dig into the cuase to find out why.
>    Please raise a Jira on this.


I think the problem is in mep_client. The
axis2_mep_client_prepare_soap_envelope creates a msg_ctx which will always
have the default isSoap11 set to false. This flag is then used to call
axis2_soap_envelope_create_default_soap_envelope.

Rather than checking AXIS2_MSG_CTX_GET_IS_SOAP_11, which will always be
false, the code could use the value set by
AXIS2_MEP_CLIENT_SET_SOAP_VERSION_URI to determine the call to
axis2_soap_envelope_create_default_soap_envelope??
Cheers,

--
Pete

Re: [Axis2C] Setting SoapAction and SOAP version in a client

Posted by Pete Robbins <ro...@googlemail.com>.
On 13/04/06, Samisa Abeysinghe <sa...@gmail.com> wrote:
>
> Hi Pete,
>    You are correct, there seems to be a bug here; the API is supposed
> to be such that you can call AXIS2_MEP_CLIENT_PREPARE_SOAP_ENVELOPE,
> then get the soap envelope though the message context returned by that
> call and set the SOAP version on that soap envelope. However, the logic
> in set SOAP version method of SOAP envelope seem to be commented out, I
> am not sure why, have to dig into the cuase to find out why.
>    Please raise a Jira on this.



Will do.

   For the time being, if you want to use SOAP 1.1 there is a work around.
> 1. Call AXIS2_MEP_CLIENT_PREPARE_SOAP_ENVELOPE and get the message
> context.
> 2. Create a SOAP envelope with SOAP 1.1 as the version (please have a
> look at axis2_soap_envelope.h for the API)
> 3. use AXIS2_MSG_CTX_SET_SOAP_ENVELOPE on the msg context instance got
> in step one and use soap envelope you created in step 2
>
> I hope this would work, but I did not test this. Please try that.
> Thanks,
> Samisa...


I think this is what the google client sample does so it should work.

Looking at the code I'm not sure if AXIS2_MSG_CTX_SET_SOAP_ENVELOPE frees up
the soap envelope that is being replaced??

Pete Robbins wrote:
>
> > How do I do this?
> >
> > I tried using axis2_stub and this allowed me to use
> > AXIS2_STUB_SET_SOAP_VERSION but I can't find a way to set the
> SOAPAction.
> >
> > So I chenged to use axis2_mep_client which allows me to use
> > AXIS2_MEP_CLIENT_SET_SOAP_ACTION but I can't find a way to set the
> > SOAP version! I tried using AXIS2_MEP_CLIENT_SET_SOAP_VERSION_URI but
> > when I call AXIS2_MEP_CLIENT_PREPARE_SOAP_ENVELOPE it always uses
> > SOAP12 :-(
> >
> > --
> > Pete
>
>
>


--
Pete

Re: [Axis2C] Setting SoapAction and SOAP version in a client

Posted by Samisa Abeysinghe <sa...@gmail.com>.
Hi Pete,
    You are correct, there seems to be a bug here; the API is supposed 
to be such that you can call AXIS2_MEP_CLIENT_PREPARE_SOAP_ENVELOPE, 
then get the soap envelope though the message context returned by that 
call and set the SOAP version on that soap envelope. However, the logic 
in set SOAP version method of SOAP envelope seem to be commented out, I 
am not sure why, have to dig into the cuase to find out why.
    Please raise a Jira on this.

    For the time being, if you want to use SOAP 1.1 there is a work around.
1. Call AXIS2_MEP_CLIENT_PREPARE_SOAP_ENVELOPE and get the message context.
2. Create a SOAP envelope with SOAP 1.1 as the version (please have a 
look at axis2_soap_envelope.h for the API)
3. use AXIS2_MSG_CTX_SET_SOAP_ENVELOPE on the msg context instance got 
in step one and use soap envelope you created in step 2

I hope this would work, but I did not test this. Please try that.
Thanks,
Samisa...

Pete Robbins wrote:

> How do I do this?
>  
> I tried using axis2_stub and this allowed me to use 
> AXIS2_STUB_SET_SOAP_VERSION but I can't find a way to set the SOAPAction.
>  
> So I chenged to use axis2_mep_client which allows me to use 
> AXIS2_MEP_CLIENT_SET_SOAP_ACTION but I can't find a way to set the 
> SOAP version! I tried using AXIS2_MEP_CLIENT_SET_SOAP_VERSION_URI but 
> when I call AXIS2_MEP_CLIENT_PREPARE_SOAP_ENVELOPE it always uses 
> SOAP12 :-(
>
> -- 
> Pete