Package org.xmlsoap.schemas.soap.envelope

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


        return envelopeDoc;
    }

    public XmlObject sendRequest(XmlObject requestDoc, String action, URL url)
    {
        EnvelopeDocument requestEnvelopeDoc = createEnvelope();
        Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
        XmlBeanUtils.addChildElement( requestEnvelope.getBody(), requestDoc );
        try
        {
            URI actionURI = new URI( action );
            if ( ResourceStub.DEBUG ) { System.out.println( "Sending request: \n" + requestEnvelopeDoc ); }
           
           
            setChanged();
            String response = SoapClient.sendRequest( url, requestEnvelopeDoc.newInputStream(), actionURI );
            XmlOptions xmlOpts = new XmlOptions().setSaveOuter();
            xmlOpts.setSavePrettyPrint();           
            EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse( response );
        notifyObservers(new WcmMessage(requestDoc.xmlText(xmlOpts), responseEnvelopeDoc.xmlText(xmlOpts)));

            if ( ResourceStub.DEBUG ) { System.out.println( "Received response: \n" + responseEnvelopeDoc ); }
            Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
            XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements( responseEnvelope.getBody() );
            if ( responseBodyElems.length == 0 )
            {
                return null;
            }
View Full Code Here


        try
        {
            URI actionURI = new URI( action );
            if ( ResourceStub.DEBUG ) { System.out.println( "Sending request: \n" + requestEnvelope ); }
            String response = SoapClient.sendRequest( url, requestEnvelope.newInputStream(), actionURI );
            EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse( response );
            if ( ResourceStub.DEBUG ) { System.out.println( "Received response: \n" + responseEnvelopeDoc ); }
            Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
            XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements( responseEnvelope.getBody() );
            if ( responseBodyElems.length == 0 )
            {
                return null;
            }
View Full Code Here

   * @param messageText
   * @return
   * @throws XmlException
   */
  private NotificationMessageHolderType getNotificationMessageHolder(String messageText) throws XmlException {
    EnvelopeDocument ed = (EnvelopeDocument) XmlObject.Factory.parse(messageText);
        org.xmlsoap.schemas.soap.envelope.Envelope env = ed.getEnvelope();
        Body body = env.getBody();
        XmlObject[] arryStuff = XmlBeanUtils.getChildElements(body);
        NotifyDocument.Notify ele = (NotifyDocument.Notify) arryStuff[0];
       
        NotificationMessageHolderType noteMess = ele.getNotificationMessageArray(0);
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 mgmtEventElem = null;
        if ( ResourceStub.USE_WRAPPED_NOTIFICATIONS ) //wrapped
        {
            //get notify
View Full Code Here

        return new XmlBeansEndpointReference( subscribeResponse.getSubscriptionReference() );
    }

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

        return envelopeDoc;
    }

    public XmlObject sendRequest( XmlObject requestDoc, String action ,String type )
    {
        EnvelopeDocument requestEnvelopeDoc = createEnvelope();
        Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
        addAddressingHeaders( requestEnvelope.getHeader(), action );
        XmlBeanUtils.addChildElement( requestEnvelope.getBody(), requestDoc );
        try
        {
            URL endpointURL = new URL( m_epr.getAddress() );
            URI actionURI = new URI( action );
            if ( DEBUG ) { System.out.println( "Sending request: \n" + requestEnvelopeDoc ); }
            String response = SoapClient.sendRequest( endpointURL, requestEnvelopeDoc.newInputStream(), actionURI );           
            setChanged();
            XmlOptions xmlOpts = new XmlOptions().setSaveOuter();
            xmlOpts.setSavePrettyPrint();
        notifyObservers(new WcmMessage(requestDoc.xmlText(xmlOpts), response,type));           
            EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse( response );
            if (DEBUG ) { System.out.println( "Received response: \n" + responseEnvelopeDoc ); }
            Envelope responseEnvelope = responseEnvelopeDoc.getEnvelope();
            XmlObject[] responseBodyElems = XmlBeanUtils.getChildElements( responseEnvelope.getBody() );
            if ( responseBodyElems.length == 0 )
            {
                return null;
            }
View Full Code Here

   * @param messageText
   * @return
   */
  private String getColorFromMessage1(String messageText) {
    try {
      EnvelopeDocument ed=(org.xmlsoap.schemas.soap.envelope.EnvelopeDocument)XmlObject.Factory.parse(messageText);
      org.xmlsoap.schemas.soap.envelope.Envelope env = ed.getEnvelope();
      Body body = env.getBody();
      XmlObject[] arryStuff = XmlBeanUtils.getChildElements(body);
      if(arryStuff.length==0)
        return "Black";
      NotifyDocument.Notify ele = (NotifyDocument.Notify) arryStuff[0];
View Full Code Here

     * @throws XmlException
     */
    private ManagementEventTypeImpl parseManagementEvent(String messageText)
            throws XmlException
    {
        EnvelopeDocument ed = (EnvelopeDocument) XmlObject.Factory.parse(messageText);
        org.xmlsoap.schemas.soap.envelope.Envelope env = ed.getEnvelope();
        Body body = env.getBody();
        XmlObject[] arryStuff = XmlBeanUtils.getChildElements(body);
        NotifyDocument.Notify ele = (NotifyDocument.Notify) arryStuff[0];
        NotificationMessageHolderType noteMess = ele.getNotificationMessageArray(0);
        XmlAnyTypeImpl mess = (XmlAnyTypeImpl) noteMess.getMessage();
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

            //put XMLbean into SOAPBody
            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

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.