Hi Dinesh,
   
  Why Axis2/C will generate wrap of soap message like:
   
  <soapenv:Envelope xmlns:soapenv = 
'http://www.w3.org/2003/05/soap-envelope'><soapenv:Header></soapenv:Header><soapenv:Body
 xmlns:soapenv = 
'http://www.w3.org/2003/05/soap-envelope'></soapenv:Body></soapenv:Envelope>
   
  But in my codes, just write some statements like:
   
      ns0 = axiom_namespace_create(env, 
AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, "SOAP-ENV");
    ns1 = axiom_namespace_create(env, 
"http://schemas.xmlsoap.org/soap/encoding/";, "SOAP-ENC");
    ns2 = axiom_namespace_create(env, 
"http://www.w3.org/1999/XMLSchema-instance";, "xsi");
    ns3 = axiom_namespace_create(env, "http://www.w3.org/1999/XMLSchema";, 
"xsd");
 ns4 = axiom_namespace_create(env, "http://stockquote";, "ns1");
   
   /* set root layer */
   envelope_ele = axiom_element_create(env, NULL, "Envelope", ns0, 
&envelope_node);
 status = axiom_element_declare_namespace(envelope_ele, env, envelope_node, 
ns1);
 printf("\n#############################%d#########################\n", status);
    axiom_element_declare_namespace(envelope_ele, env, envelope_node, ns2);
 axiom_element_declare_namespace(envelope_ele, env, envelope_node, ns3);
    axiom_element_declare_namespace(envelope_ele, env, envelope_node, ns4);
  
 /* set first layer */
 body_ele = axiom_element_create(env, envelope_node, "SOAP-ENV:Body", NULL, 
&body_node);
 
 b0101_ele = axiom_element_create(env, body_node, "ns1:getQuote", NULL, 
&b0101_node);
   b0201_ele = axiom_element_create(env, b0101_node, "ns1:symbol", NULL, 
&b0201_node); 
 status = axiom_element_set_text(b0201_ele, env, "ABC", b0201_node);
   
  Could I wipe off them using some apis?
   
  Although using axiom_node_to_string to print soap message, there is no this 
wrap, but if you use tcpmon to look at, it will display real appearence.
  

Kelvin Lin <[EMAIL PROTECTED]> wrote:
    Hi Dinesh,
   
  Thank you for your reminder.
   
  I used tcpmon to moniter the soap message and found a weird result.
   
  Here is my whole code:
   
  axiom_node_t *
build_om_payload_for_echo_svc2(const axutil_env_t *env)
{
    axiom_node_t *echo_om_node = NULL;
    axiom_element_t* echo_om_ele = NULL;
    axiom_node_t* text_om_node = NULL;
    axiom_element_t * text_om_ele = NULL;
    
    axis2_char_t *om_str = NULL;
   /* the root layer */
 axiom_node_t *envelope_node = NULL;
 axiom_element_t *envelope_ele = NULL;
 //axiom_namespace_t *ns1 = NULL;
 axis2_status_t status;
   /* the first layer */
 axiom_node_t *body_node = NULL;
 axiom_element_t *body_ele = NULL;
   axiom_node_t *b0101_node = NULL;
 axiom_element_t *b0101_ele = NULL;
   axiom_node_t *b0201_node = NULL;
 axiom_element_t *b0201_ele = NULL;
   axiom_namespace_t *ns0 = NULL, *ns1 = NULL, *ns2 = NULL, *ns3 = NULL, *ns4 = 
NULL;
      ns0 = axiom_namespace_create(env, 
AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, "SOAP-ENV");
    ns1 = axiom_namespace_create(env, 
"http://schemas.xmlsoap.org/soap/encoding/";, "SOAP-ENC");
    ns2 = axiom_namespace_create(env, 
"http://www.w3.org/1999/XMLSchema-instance";, "xsi");
    ns3 = axiom_namespace_create(env, "http://www.w3.org/1999/XMLSchema";, 
"xsd");
 ns4 = axiom_namespace_create(env, "http://stockquote";, "ns1");
   
   /* set root layer */
   envelope_ele = axiom_element_create(env, NULL, "Envelope", ns0, 
&envelope_node);
 status = axiom_element_declare_namespace(envelope_ele, env, envelope_node, 
ns1);
 printf("\n#############################%d#########################\n", status);
    axiom_element_declare_namespace(envelope_ele, env, envelope_node, ns2);
 axiom_element_declare_namespace(envelope_ele, env, envelope_node, ns3);
    axiom_element_declare_namespace(envelope_ele, env, envelope_node, ns4);
  
 /* set first layer */
 body_ele = axiom_element_create(env, envelope_node, "SOAP-ENV:Body", NULL, 
&body_node);
 
 b0101_ele = axiom_element_create(env, body_node, "ns1:getQuote", NULL, 
&b0101_node);
   b0201_ele = axiom_element_create(env, b0101_node, "ns1:symbol", NULL, 
&b0201_node); 
 status = axiom_element_set_text(b0201_ele, env, "ABC", b0201_node);
 printf("\n#############################%d#########################\n", status);
   
  
 om_str = axiom_node_to_string(envelope_node, env);
    if (om_str)
    {
        printf("\nSending OM : %s\n", om_str);
        AXIS2_FREE(env->allocator, om_str);
        om_str =  NULL;
    }
    return envelope_node;
}
   
  I used printf to display om_str is:
   
  Sending OM : <SOAP-ENV:Envelope xmlns:SOAP-ENV = 
'http://schemas.xmlsoap.org/soap/envelope/' xmlns:ns1 = 'http://stockquote' 
xmlns:xsi = 'http://www.w3.org/1999/XMLSchema-instance' xmlns:SOAP-ENC = 
'http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsd = 
'http://www.w3.org/1999/XMLSchema'><SOAP-ENV:Body><ns1:getQuote><ns1:symbol>ABC</ns1:symbol></ns1:getQuote></SOAP-ENV:Body></SOAP-ENV:Envelope>
   
  But I used tcpmon to monitor is:
   
  <soapenv:Envelope xmlns:soapenv = 
'http://www.w3.org/2003/05/soap-envelope'><soapenv:Header></soapenv:Header><soapenv:Body
 xmlns:soapenv = 'http://www.w3.org/2003/05/soap-envelope'><SOAP-ENV:Envelope 
xmlns:SOAP-ENV = 'http://schemas.xmlsoap.org/soap/envelope/' xmlns:ns1 = 
'http://stockquote' xmlns:xsi = 'http://www.w3.org/1999/XMLSchema-instance' 
xmlns:SOAP-ENC = 'http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsd = 
'http://www.w3.org/1999/XMLSchema'><SOAP-ENV:Body><ns1:getQuote><ns1:symbol>ABC</ns1:symbol></ns1:getQuote></SOAP-ENV:Body></SOAP-ENV:Envelope></soapenv:Body></soapenv:Envelope>
   
  I want the exactly soap message is:
   
  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
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";>
<SOAP-ENV:Body>
<ns1:getQuote>
<ns1:symbol>IBM</ns1:symbol> 
</ns1:getQuote>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
   
  Why could be this? I have no any idea. How should I do, then I can get the 
soap message I want.
   
  Best regards.
   
  Kelvin.Lin

Dinesh Premalal <[EMAIL PROTECTED]> wrote:
  Kelvin,
Please find my comments inline.
Kelvin Lin writes:
> 
> 1st, I don't know whether single squote "\'" will affect the soap message or
> not. Because in the correct format, soap message uses double squote "\"". It
> means xmlns:ns1 = "http://stockquote"; not xmlns:ns1 =
> 'http://stockquote'.
I think single quote should not affect the soap message because it
does not affect for welformness of the xml document. [1]
> 
> 2nd, it is still in disorder sequence. Because I want get the soap message 
> like
> the following order:
> 
> > 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";>
> 
> It means ns xmlns:SOAP-ENV is in the first place, xmlns:SOAP-ENC in the second
> place and xmlns:xsi in the third place.
Please let me see what happen there, will get back to you soon.

> 
> 3rd, in the server concole, there are some error infos for wrong soap message:
> 
> [7/9/07 13:58:36:953 CST] 50d0aea1 WebServicesSe E
> com.ibm.ws.webservices.engine.transport.http.WebServicesServlet WSWS3112E:
> Error: Generating WebServicesFault due to missing SOAPAction.
> [7/9/07 13:58:36:953 CST] 50d0aea1 WebServicesSe E
> com.ibm.ws.webservices.engine.transport.http.WebServicesServlet TRAS0014I: The
> following exception was logged WebServicesFault
> faultCode: {http://websphere.ibm.com/webservices/}Client.NoSOAPAction
> faultString: WSWS3147E: Error: no SOAPAction header!
> faultActor: null
> faultDetail:
> WSWS3147E: Error: no SOAPAction header!
Could you please show us transferred SOAP message, you can catch it
using TCPMon tool. Seems some problem with SOAP message.
> but return value of function axis2_svc_client_send_receive(svc_client, env,
> payload) is NULL, meaning no getting any response even error
> message.
What does the log says? 
> 
> #####################################################
> 
> Then I used attribute apis like this to create soap message:

I think this method is not correct, I'm afraid, axiom attributes does
not intended to create namespaces. At the xml document object model
level there are more details to handle in namespaces than in
attributes. 

thanks,
Dinesh

1.http://www.w3.org/TR/REC-xml-names/#sec-intro
-- 
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]


    
---------------------------------
  Need a vacation? Get great deals to amazing places on Yahoo! Travel. 


Best Regards!

Kelvin.Lin
       
---------------------------------
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing. 

Reply via email to