Package org.xmlsoap.schemas.soap.envelope

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


         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


      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

         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

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

        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

     */
    private Object loadMetadataFromEPR(EndpointReferenceType epr) throws IOException, URISyntaxException, XmlException
    {
        String address = epr.getAddress().getStringValue();
        //send WS-MEX Get request
        EnvelopeDocument envelope = buildSoapEnvelopeForGet(address, epr);
        String response = SoapClient.sendRequest(new URL(address),envelope.newInputStream(),new URI(MetadataExchangeConstants.ACTION_GET));
        return XmlObject.Factory.parse(response);
    }
View Full Code Here

     * @param endpointReferenceType
     * @return The SOAP Envelope for making a request.
     */
    private EnvelopeDocument buildSoapEnvelopeForGet(String address, EndpointReferenceType endpointReferenceType)
    {
        EnvelopeDocument envelopeDocument = EnvelopeDocument.Factory.newInstance();
        Envelope envelope = envelopeDocument.addNewEnvelope();
        envelope.addNewBody();
        Header header = envelope.addNewHeader();
        XmlObject toElem;
        XmlObject actionElem;
        org.xmlsoap.schemas.ws.x2004.x08.addressing.ToDocument toDoc = org.xmlsoap.schemas.ws.x2004.x08.addressing.ToDocument.Factory.newInstance();
View Full Code Here

    public void createPrinter() throws IOException
    {
        String response = sendRequest(m_printerFactoryURL, SOAP_REQ_CREATE_PRINTER);
        System.out.println("Create Printer Reponse: \n" + response);
        assertTrue(response.indexOf("CreatePrinterResponse") > -1);
        EnvelopeDocument envelopeDocument = loadResponseEnvelope(response);
        CreatePrinterResponseDocument.CreatePrinterResponse createPrinter = (CreatePrinterResponseDocument.CreatePrinterResponse) XmlBeanUtils.getChildElements(envelopeDocument.getEnvelope().getBody(), new QName(PrinterPortPropertyQNames.PRINTER_REFERENCE.getNamespaceURI(), "CreatePrinterResponse"))[0];
        setPrinterURL(createPrinter);
        setPrinterReferenceProps(createPrinter);
    }
View Full Code Here

    public void testValidatePrinterInitialState() throws IOException
    {
        String response = sendPrinterRequest("GetPrinterPropertiesDoc.soap");
        System.out.println("Printer Prop Doc: \n" + response);
        assertTrue(response.indexOf("printer_properties") > -1);
        EnvelopeDocument envelopeDocument = loadResponseEnvelope(response);

        Body body = envelopeDocument.getEnvelope().getBody();
        XmlObject[] childElements = XmlBeanUtils.getChildElements(body, new QName("http://docs.oasis-open.org/wsrf/2004/11/wsrf-WS-ResourceProperties-1.2-draft-05.xsd","GetResourcePropertyDocumentResponse"));
        XmlObject childElement = childElements[0];
        XmlObject[] printerprops = XmlBeanUtils.getChildElements(childElement, new QName(PrinterPortPropertyQNames.QUEUED_JOB_COUNT.getNamespaceURI(), "printer_properties"));
        XmlInteger elem = (XmlInteger) XmlBeanUtils.getChildElements(printerprops[0], PrinterPortPropertyQNames.QUEUED_JOB_COUNT)[0];
        assertTrue(elem.getBigIntegerValue().intValue() == 0);
View Full Code Here

    }

    public void testDestroy_SCENARIO_D() throws IOException
    {
        String jobResponse = printJob();
        EnvelopeDocument envelope = loadResponseEnvelope(jobResponse);
        XmlBeanUtils.getChildElements(getCreationResponse(envelope));

        setJobURL(envelope);
        EnvelopeDocument destroyEnvelopeDocument = loadDocument("Destroy_Job.soap");
        addReferencePropsToEnvelope(destroyEnvelopeDocument, getJobEndpointReference(envelope).getReferenceProperties());

        System.out.println("Destroying JOB: ");
        String response = sendJobRequest(destroyEnvelopeDocument);
        assertTrue(response.indexOf("DestroyResponse") > -1);
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.