Thanks Nandika. I have gone through the OM tutorial : http://ws.apache.org/axis2/c/docs/om_tutorial.html
Is there an api available which we can use to search for a particular element ?? Or the only way possible is to traverse it ? ( which i'll be taking a crack at now) Cheers! On Mon, Jul 19, 2010 at 4:46 PM, Nandika Jayawardana <[email protected]>wrote: > In your code you are adding the namespaces to the greet element and its > serialized in that way. If you want the namespace to be in the soap > envelope, you need to get the axiom element of soap envelope and declare the > namespace there. > > Regards > Nandika > > > On Mon, Jul 19, 2010 at 8:05 PM, Rico M <[email protected]> wrote: > >> 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! >> > > > > -- > http://nandikajayawardana.blogspot.com/ > WSO2 Inc: http://www.wso2.com >
