On 7/16/07, Kelvin Lin <[EMAIL PROTECTED]> wrote:

Hi Dinesh,

Thanks a lot for your reply.

I followed your suggestion, specifying SOAP1.1 explicitly. But it failed
either.

Here are the codes:

    /* Setup options */
    options = axis2_options_create(env);
    axis2_options_set_to(options, env, endpoint_ref);
    axis2_options_set_soap_version(options, env, AXIOM_SOAP11);

Here are the console output, based on sample echo.c, together with the
official release:

AXIS2C_HOME is not set - log is written to . dir
Using endpoint :
http://localhost:9081/WebProject/services/StockQuoteService
Sending OM : <SOAP-ENV:Envelope xmlns:ns1="http://stockquote";
xmlns:xsi="http://
www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="
http://schemas.xmlsoap.org/s
oap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:
xsd="
http://www.w3.org/1999/XMLSchema";><SOAP-ENV:Body><ns1:getQuote><ns1:symbol<http://www.w3.org/1999/XMLSchema%22%3E%3CSOAP-ENV:Body%3E%3Cns1:getQuote%3E%3Cns1:symbol>
>
IBM</ns1:symbol></ns1:getQuote></SOAP-ENV:Body></SOAP-ENV:Envelope>

Received OM : <soapenv:Fault><faultcode xmlns="">Server.generalException
</faultc
ode><faultstring xmlns="">WSWS3277E: Error: No such operation
'Envelope'</faults
tring><detail xmlns=""></detail></soapenv:Fault>
echo client invoke SUCCESSFUL!

and here are the monitor data catched by tcpmon:

POST /WebProject/services/StockQuoteService HTTP/1.1
User-Agent: Axis2/C
SOAPAction: ""
Content-Length: 531
Content-Type: text/xml;charset=UTF-8
Host: localhost:9081
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Header></soapenv:Header><soapenv:Body><SOAP-ENV:Envelope<http://schemas.xmlsoap.org/soap/envelope/%22%3E%3Csoapenv:Header%3E%3C/soapenv:Header%3E%3Csoapenv:Body%3E%3CSOAP-ENV:Envelope>xmlns:ns1="
http://stockquote"; xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="
http://www.w3.org/1999/XMLSchema";><SOAP-ENV:Body><ns1:getQuote><ns1:symbol>IBM</ns1:symbol></ns1:getQuote></SOAP-ENV:Body></SOAP-ENV:Envelope></soapenv:Body></soapenv:Envelope
>

It still adds some additional data like "header" and "body".

What's happed?


You only need to build the payload and pass it to
axis2_svc_client_send_receive.

The payload:
<ns1:getQuote><ns1:symbol>IBM</ns1:symbol></ns1:getQuote>

By looking at the namespace of the envelope (
http://schemas.xmlsoap.org/soap/envelope/<http://schemas.xmlsoap.org/soap/envelope/%22%3E%3Csoapenv:Header%3E%3C/soapenv:Header%3E%3Csoapenv:Body%3E%3CSOAP-ENV:Envelope>),
you need to use SOAP 1.1 instead of SOAP 1.2. That's why you need to set the
version (Otherwise the engine assumes the default version 1.2).

axis2_options_set_soap_version(options, env, AXIOM_SOAP11);


By the way, what is this three statements' effect?

    soap_action = axutil_string_create(env, "
http://ws.apache.org/axis2/c/samples/echo/soap_action";);
    axis2_options_set_soap_action(options, env, soap_action);
    axutil_string_free(soap_action, env);
What does soap_action mean?



When using SOAP 1.1 (over HTTP), you MUST set SOAPAction HTTP header which
is usually used to identify the intent of the  SOAP action.  The value we
set is a URI identifying the intent. For the above code, you'll see the
following HTTP header.

SOAPAction: "http://ws.apache.org/axis2/c/samples/echo/soap_action";


Hope this helps.

Nabeel.

Thanks a lot.

*Dinesh Premalal <[EMAIL PROTECTED]>* wrote:

Kelvin Lin writes:
>
> I used printf to display om_str is:
>
> Sending OM :
> ABC> SOAP-ENV:Envelope>
>
> But I used tcpmon to monitor is:
>
>
> > 'http://www.w3.org/1999/XMLSchema-instance' xmlns:SOAP-ENC = 'http://
> schemas.xmlsoap.org/soap/encoding/' xmlns:xsd = 'http://www.w3.org/1999/
> XMLSchema'>ABC> ns1:getQuote>> soapenv:Envelope>
>
> I want the exactly soap message is:
>
> > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:xsi="http://
> www.w3.org/1999/XMLSchema-instance" xmlns:xsd="
http://www.w3.org/1999/XMLSchema
> " xmlns:ns1="http://stockquote";>
>
>
> IBM
>
>
>
>
> Why could be this? I have no any idea. How should I do, then I can get
the soap
> message I want.
This because your service client send SOAP1.2 message. If you need to
use SOAP1.1 need to tell it explicitly.

axis2_options_set_soap_version(options, env, AXIOM_SOAP11);

option will work. Please refer echo_blocking_soap11 [1] sample for
more information.

thanks,
Dinesh


[1].http://svn.apache.org/repos/asf/webservices/axis2/trunk/c/samples/user_guide/clients/echo_blocking_soap11.c

--
Dinesh Premalal
http://xydinesh.wordpress.com/
GPG ID : A255955C
GPG Key Finger Print : C481 E5D4 C27E DC34 9257 0229 4F44 266E A255 955C

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Best Regards!

Kelvin.Lin

------------------------------
Boardwalk for $500? In 2007? Ha!
Play Monopoly Here and 
Now<http://us.rd.yahoo.com/evt=48223/*http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow>(it's
 updated for today's economy) at Yahoo! Games.




--
http://www.cs.purdue.edu
http://mohamednabeel.blogspot.com

Reply via email to