You can obtain the service client struct and from that, you can get the
axis2 options instance associated with the stub. The set the SOAP version to
the options.

svc_client = axis2_stub_get_svc_client(stub, env);
options = axis2_svc_client_get_options(svc_client, env);
axis2_options_set_soap_version(options, env, AXIOM_SOAP12);

This should solve your issue.

Regards
Nandika


On Sun, Jan 31, 2010 at 5:25 AM, <paul.dead...@longfield.co.uk> wrote:

>
> Hi
>
> I have a problem with the SOAP version, with Axis2c as a client (on XP) to
> a WCF service. The WCF Service is a wsHttpbinding with Anonymous
> authentication. (As an aside im using 1.6.0 which I downloaded 2 days ago.
> The binary version appeared to have a problem with the file seperator to
> locate the lib directory, so I took the source, change the file seperator in
> the windows specific elements to "\" compiled it and it allowed it to load
> the http sender.)
>
> Now down to my problem:-
>
> 1. I get the following in the log file:-
>
> [Sat Jan 30 23:02:06 2010] [debug]
> ..\..\src\core\transport\http\sender\http_transport_sender.c(246) ctx_epr:
> http://win7dev03/mexdelegation/emmdel.svc
> [Sat Jan 30 23:02:06 2010] [debug]
> ..\..\src\core\transport\http\sender\http_transport_sender.c(805) using
> axis2 native http sender.
> [Sat Jan 30 23:02:06 2010] [debug]
> ..\..\src\core\transport\http\sender\http_sender.c(416)
> msg_ctx_id:urn:uuid:3979014b-3c85-465b-ba42-50fa313230c0
> [Sat Jan 30 23:02:07 2010] [error]
> ..\..\src\core\transport\http\sender\http_sender.c(1442) Error occurred in
> transport
> [Sat Jan 30 23:02:07 2010] [error] ..\..\src\core\engine\engine.c(179)
> Transport sender invoke failed
> [Sat Jan 30 23:02:07 2010] [error] c:\documents and settings\pdeadman\my
> documents\visual studio
> 2008\projects\testaxisclient\testaxisclient\testaxisclient.cpp(92) Stub
> invoke FAILED: Error code: 74 :: Error occurred in transport
>
> 2. I get the following from a network trace
>
> This is in the Content-Type:
>
> text/xml;charset=UTF-8
>
>
> And the following is returned:-
>
> HTTP/1.1 415 Cannot process the message because the content type
> 'text/xml;charset=UTF-8' was not the expected type 'application/soap+xml;
> charset=utf-8'.\r\n
>
> 3) In the code I have inserted a line
>
> int mysoapver = axis2_options_get_soap_version(options,env);
>
> Which returns a value of 2.
>
> Do I have to specify any specific options to force SOAP1.2 ?
>
> The code in question is fairly simple, I using a stub from the WSDL2C to
> create the service (named "Service1" here) and then calling the method
> ConnectMEX.
> The mysoapver is returned with a value of 2.
>
>         myservice =
> axis2_stub_create_Service1(env,client_home,endpoint_ref);
>
>         int mysoapver = axis2_options_get_soap_version(options,env);
>
>         // Try to force application/xml+soap
>         rc=axis2_options_set_soap_version(options,env,AXIOM_SOAP12);
>
>         adb_ConnectMEXResponse_t *response=NULL;
>         adb_ConnectMEX_t *package;
>         package = adb_ConnectMEX_create(env);
>
>         response =
> axis2_stub_op_Service1_ConnectMEX(myservice,env,package);
>
>
> Im new to AXIS2C but have used other web service apps.
>
> Paul Deadman
> Mobile: 07769 930 235
> Skype: Paul Deadman, York
>
>


-- 
http://nandikajayawardana.blogspot.com/
WSO2 Inc: http://www.wso2.com

Reply via email to