Package org.xmlsoap.schemas.soap.envelope

Examples of org.xmlsoap.schemas.soap.envelope.EnvelopeDocument


    }


    private EnvelopeDocument loadResponseEnvelope(String response)
    {
        EnvelopeDocument envelope = null;
        try
        {
            envelope = EnvelopeDocument.Factory.parse(response);

        }
View Full Code Here


    }

    private EnvelopeDocument loadDocument(String requestFile)
            throws IOException
    {
        EnvelopeDocument envelopeDoc = null;
        try
        {
            envelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse(new File(m_requestsDir, requestFile));
        }
        catch (XmlException e)
View Full Code Here

*/
public class RequestUtils
{
    public static XmlObject sendRequest(XmlObject requestDoc, String action, EndpointReference epr)
    {
        EnvelopeDocument requestEnvelopeDoc = createEnvelope();
        Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
        addAddressingHeaders(requestEnvelope.getHeader(), action, epr);
        XmlBeanUtils.addChildElement(requestEnvelope.getBody(), requestDoc);
        try
        {
            URL endpointURL = new URL(epr.getAddress());
            System.out.println("Sending Request to " + endpointURL.toString());
            URI actionURI = new URI(action);
            String response = SoapClient.sendRequest(endpointURL, requestEnvelopeDoc.newInputStream(), actionURI);
            EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse(response);
            Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
            XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements(responseEnvelope.getBody());
            System.out.println("Received response from " + endpointURL.toString());
            System.out.println(responseBodyElems[0].toString());
            if (responseBodyElems.length == 0)
            {
View Full Code Here

        }
    }

    public static XmlObject sendRequest(XmlObject requestDoc, String action, String address)
    {
        EnvelopeDocument requestEnvelopeDoc = createEnvelope();
        Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
        addAddressingHeaders(requestEnvelope.getHeader(), action, address);
        XmlBeanUtils.addChildElement(requestEnvelope.getBody(), requestDoc);
        try
        {
            System.out.println("Sending request to: " + address);
            URL endpointURL = new URL(address);
            URI actionURI = new URI(action);
            String response = SoapClient.sendRequest(endpointURL, requestEnvelopeDoc.newInputStream(), actionURI);
            EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse(response);
            Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
            XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements(responseEnvelope.getBody());
            if (responseBodyElems.length == 0)
            {
                return null;
            }
View Full Code Here

        return epr;
    }

    private static EnvelopeDocument createEnvelope()
    {
        EnvelopeDocument envelopeDoc = EnvelopeDocument.Factory.newInstance();
        Envelope envelope = envelopeDoc.addNewEnvelope();
        envelope.addNewHeader();
        envelope.addNewBody();
        return envelopeDoc;
    }
View Full Code Here

*/
public class NotifRequestUtils
{
    public static XmlObject sendRequest(XmlObject requestDoc, String action, EndpointReference epr)
    {
        EnvelopeDocument requestEnvelopeDoc = createEnvelope();
        Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
        addAddressingHeaders(requestEnvelope.getHeader(), action, epr);
        XmlBeanUtils.addChildElement(requestEnvelope.getBody(), requestDoc);
        try
        {
            URL endpointURL = new URL(epr.getAddress());
            System.out.println("Sending Request to " + endpointURL.toString());
            URI actionURI = new URI(action);
            String response = SoapClient.sendRequest(endpointURL, requestEnvelopeDoc.newInputStream(), actionURI);
            EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse(response);
            Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
            XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements(responseEnvelope.getBody());
            System.out.println("Recieved response from " + endpointURL.toString());
            if (responseBodyElems.length == 0)
            {
                return null;
View Full Code Here

         soapm.getSOAPBody(  ).addDocument( (org.w3c.dom.Document) sdom.newDomNode(  ) );
         SOAPMessage                   subscribeResponse = sconn.call( soapm,
                                                                       epr.getAddress(  ).toString(  ) );
         java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream(  );
         subscribeResponse.writeTo( os );
         EnvelopeDocument sres =
            EnvelopeDocument.Factory.parse( new java.io.ByteArrayInputStream( os.toByteArray(  ) ) );

         //extract SubscribeResponse from SOAPBody

         /*SubscribeResponseDocument sresdom = SubscribeResponseDocument.Factory.newInstance();
            sresres= sresdom.addNewSubscribeResponse();
            sresres.set(sres.getEnvelope().getBody());
          */

         //TODO handle faults
         SubscribeResponseDocument sresdom =
            SubscribeResponseDocument.Factory.parse( sres.getEnvelope(  ).getBody(  ).xmlText(  ) );
         sresres = sresdom.getSubscribeResponse(  );
      }
      catch ( Exception e )
      {
         e.printStackTrace(  );
View Full Code Here

        return epr;
    }

    private static EnvelopeDocument createEnvelope()
    {
        EnvelopeDocument envelopeDoc = EnvelopeDocument.Factory.newInstance();
        Envelope envelope = envelopeDoc.addNewEnvelope();
        envelope.addNewHeader();
        envelope.addNewBody();
        return envelopeDoc;
    }
View Full Code Here

         soapm.getSOAPBody(  ).addDocument( (org.w3c.dom.Document) sdom.newDomNode(  ) );
         SOAPMessage                   subscribeResponse = sconn.call( soapm,
                                                                       epr.getAddress(  ).toString(  ) );
         java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream(  );
         subscribeResponse.writeTo( os );
         EnvelopeDocument sres =
            EnvelopeDocument.Factory.parse( new java.io.ByteArrayInputStream( os.toByteArray(  ) ) );

         //TODO handle faults
         SubscribeResponseDocument sresdom =
            SubscribeResponseDocument.Factory.parse( sres.getEnvelope(  ).getBody(  ).xmlText(  ) );
         sresres = sresdom.getSubscribeResponse(  );
      }
      catch ( Exception e )
      {
         e.printStackTrace(  );
View Full Code Here

      assertTrue( incomingMsg, incomingMsg.indexOf( "ERROR" ) == -1 );

      //get envelope
      XmlObject xmlObject = XmlObject.Factory.parse( incomingMsg );
      assertTrue( "The returned message was not a SOAP Envelope.", xmlObject instanceof EnvelopeDocument );
      EnvelopeDocument envelope = (EnvelopeDocument) xmlObject;
      Body             body = envelope.getEnvelope(  ).getBody(  );

      XmlObject        event = null;
      if ( isWrapped ) //wrapped
      {
         //get notify
View Full Code Here

TOP

Related Classes of org.xmlsoap.schemas.soap.envelope.EnvelopeDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.