You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2009/01/20 10:23:59 UTC

[jira] Resolved: (AXIS2-4215) How can I add a namespace definition to SOAP Envelope

     [ https://issues.apache.org/jira/browse/AXIS2-4215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen resolved AXIS2-4215.
------------------------------------

    Resolution: Invalid

As the name of the method implies, addHeadersToEnvelope adds the headers configured on the ServiceClient to the given SOAPEnvelope. That doesn't mean that the ServiceClient will use that SOAPEnvelope instance to send the message. Probably you will have to use the lower level OperationClient API to manipulate the SOAP envelope in this way.

PS: Please use the mailing list for this type of questions.

> How can I add a namespace definition to SOAP Envelope
> -----------------------------------------------------
>
>                 Key: AXIS2-4215
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4215
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>    Affects Versions: 1.3
>         Environment: Windows/JBOSS/AXIS2-1.3
>            Reporter: Doug Guzek
>
> I know of no other place but here to ask this question:
> I am building a SOAP message for a response to my web service. I am able to build everything except for adding NameSpace definitions to the soap:Envelope.
> How can I add the following 2 namespaces to the soap:Envelope...
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> ....so that it looks like this?
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 	<soap:Header
> 		xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> 		<payloadManifest
> 			xmlns="http://www.starstandards.org/webservices/2003/12/transport">
> 			<manifest xmlns="" id="719409674" namespaceURI=""
> 				element="ProcessRepairOrder" />
> 		</payloadManifest>
> I tried several things...one of which I thought this should work, but doesnt:
> //This loading of 2 namespaces to SOAPEnvelope does NOT seem to be working
> org.apache.axiom.soap.SOAPFactory soap11Factory =
> OMAbstractFactory.getSOAP11Factory();
> org.apache.axiom.soap.SOAPEnvelope se = soap11Factory.getDefaultEnvelope();
> OMFactory nsfactory = OMAbstractFactory.getOMFactory();
> OMNamespace hdrNs1 = nsfactory.createOMNamespace("http://www.w3.org/2001/XMLSchema-instance","xsi");
> OMNamespace hdrNs2 = nsfactory.createOMNamespace("http://www.w3.org/2001/XMLSchema","xsd");
> se.declareNamespace(hdrNs1);
> se.declareNamespace(hdrNs2);
> serviceClient.addHeadersToEnvelope(se);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.