You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by John Ferron <jo...@alliantenergy.com> on 2006/07/03 20:53:09 UTC

Converting from Glue to Axis2.0

All,
 
I'm trying to converting a web-based publishing util from Glue to Axis 2.0 and what I am trying to do (which I have found lacking in the samples from the install), is a example of how to add a standard soap header to an XML document.  (Yes, I'm a slight newbie).  What I am trying to accomplish is the have the operability to be able to use SOAP 1.1 or SOAP 1.2.  All I'm trying to do is to read in a XML doc (which is done via commons-upload) and wrap that with a standard SOAP envelope/header.  I have tried experimenting with the SOAP11Factory, and the SOAP12Factory, but could not get the xml document to load correctly in the soap document.
 
For example (Here is the soap header I'm trying to add): 
 
<?xml version='1.0' encoding='UTF-8'?>
  <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
    <soap:Body>
      <myOperation xmlns='http://www.themindelectric.com/wsdl/virtual/'>
        <myXMLDocument>
          .
          . 
          .
          .
        </myXMLDocument>
      </myOperation>
    </soap:Body>
  </soap:Envelope>
 
myOperation refers to a operation is a WSDL file that we will be publishing to.  I am NOT trying to bind this to a specifc WSDL, (so I'm assuming I do not need to perform the whole WSDL2Java operation).  If anyone could help me out, that would be greatly appreciated.
 
John


Re: Converting from Glue to Axis2.0

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi,
You can just create an OMElement out of the string and attach that to
a default SOAP envelope.

1. use the staxOMBuilder to parse the file and generate an OMElement out of it.
see [1]
2. Use the SOAPxxFactory.getDefaultEnvelope() to get an envelope
object. Use the getBody().addChild(xxx) method to attach the
OMElement.

That should do the trick :)

Ajith
[1] http://ws.apache.org/axis2/1_0/OMTutorial.html


On 7/4/06, John Ferron <jo...@alliantenergy.com> wrote:
>
>
> All,
>
> I'm trying to converting a web-based publishing util from Glue to Axis 2.0
> and what I am trying to do (which I have found lacking in the samples from
> the install), is a example of how to add a standard soap header to an XML
> document.  (Yes, I'm a slight newbie).  What I am trying to accomplish is
> the have the operability to be able to use SOAP 1.1 or SOAP 1.2.  All I'm
> trying to do is to read in a XML doc (which is done via commons-upload) and
> wrap that with a standard SOAP envelope/header.  I have tried experimenting
> with the SOAP11Factory, and the SOAP12Factory, but could not get the xml
> document to load correctly in the soap document.
>
> For example (Here is the soap header I'm trying to add):
>
> <?xml version='1.0' encoding='UTF-8'?>
>   <soap:Envelope
> xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
>     <soap:Body>
>       <myOperation
> xmlns='http://www.themindelectric.com/wsdl/virtual/'>
>         <myXMLDocument>
>           .
>           .
>           .
>           .
>         </myXMLDocument>
>       </myOperation>
>     </soap:Body>
>   </soap:Envelope>
>
> myOperation refers to a operation is a WSDL file that we will be publishing
> to.  I am NOT trying to bind this to a specifc WSDL, (so I'm assuming I do
> not need to perform the whole WSDL2Java operation).  If anyone could help me
> out, that would be greatly appreciated.
>
> John


-- 
Ajith Ranabahu

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org