axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rico M <rickom...@gmail.com>
Subject Modifying envelope of Axis
Date Mon, 19 Jul 2010 14:35:46 GMT
Hi,

I am trying to modify the SOAP envelope generated by Axis. What i need to do
is add some name spaces to it.

   <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">


I tried to add the name spaces to it via the following call :

    axiom_node_t* greet_om_node = NULL;
    axiom_element_t * greet_om_ele = NULL;
    axiom_namespace_t *ns0=NULL,*ns2 = NULL,*ns3 = NULL;

   ns0 =axiom_namespace_create(env,
AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI,"soap");
   ns2 =axiom_namespace_create(env, "
http://www.w3.org/1999/XMLSchema-instance", "xsi");
   ns3 =axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema",
"xsd");

    greet_om_ele = axiom_element_create(env, NULL, "greet", ns0,
&greet_om_node);
    axiom_element_declare_namespace(greet_om_ele, env, greet_om_node, ns2);
    axiom_element_declare_namespace(greet_om_ele, env, greet_om_node, ns3);
    axiom_element_set_text(greet_om_ele, env, "Hello Server!",
greet_om_node);


This however adds it to the element. i.e. :

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body><soap:greet
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="
http://www.w3.org/2001/XMLSchema">Hello
Server!</soap:greet></soap:Body></soap:Envelope>

Can you please suggest what is wrong above?

Cheers!

Mime
View raw message