Package org.xmlsoap.schemas.soap.envelope

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


            //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()));
           
            //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 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;
    }

    private XmlObject sendRequest( XmlObject requestDoc, String action )
    {
        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 ( AbstractWsdmInteropTestCase.DEBUG ) { System.out.println( "Sending request: \n" + requestEnvelopeDoc ); }
            String response = SoapClient.sendRequest( endpointURL, requestEnvelopeDoc.newInputStream(), actionURI );
            EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse( response );
            if ( AbstractWsdmInteropTestCase.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

        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

        QueryRelationshipsByTypeDocument requestDoc = QueryRelationshipsByTypeDocument.Factory.newInstance();
        QueryRelationshipsByTypeDocument.QueryRelationshipsByType queryRelationshipsByType = requestDoc.addNewQueryRelationshipsByType();
        queryRelationshipsByType.setRequestedType(type);
        URL url = new URL(m_url,"weatherstation");

        EnvelopeDocument requestEnvelopeDoc = createEnvelope();
        Envelope requestEnvelope = requestEnvelopeDoc.getEnvelope();
        XmlBeanUtils.addChildElement( requestEnvelope.getBody(), requestDoc );

        QName qName = new QName(WeatherstationPropertyQNames.FCCID.getNamespaceURI(),"ResourceID");

View Full Code Here

    }


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

        return envelopeDoc;
    }

    private 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 ( AbstractWsdmInteropTestCase.DEBUG ) { System.out.println( "Sending request: \n" + requestEnvelopeDoc ); }
            String response = SoapClient.sendRequest( url, requestEnvelopeDoc.newInputStream(), actionURI );
            EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse( response );
            if ( AbstractWsdmInteropTestCase.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 ( AbstractWsdmInteropTestCase.DEBUG ) { System.out.println( "Sending request: \n" + requestEnvelope ); }
            String response = SoapClient.sendRequest( url, requestEnvelope.newInputStream(), actionURI );
            EnvelopeDocument responseEnvelopeDoc = (EnvelopeDocument) XmlObject.Factory.parse( response );
            if ( AbstractWsdmInteropTestCase.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

*/
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

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.