Package org.xmlsoap.schemas.soap.envelope

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


        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


    * @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 =
View Full Code Here

          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_REQUEST ) );
      return XmlObject.Factory.parse( response );
   }
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


    public void testSetTerminationTime_SCENARIO_E_CONTINUED() throws IOException
    {
        String response = createJob();
        EnvelopeDocument responseEnvelope = loadResponseEnvelope(response);
        setJobURL(responseEnvelope);


        EnvelopeDocument envelopeDoc = null;
        envelopeDoc = loadDocument("SetTerminationTime.soap");
        addReferencePropsToEnvelope(envelopeDoc, getJobEndpointReference(responseEnvelope).getReferenceProperties());
        Calendar instance = Calendar.getInstance();
        instance.set(Calendar.MINUTE, instance.get(Calendar.MINUTE) + 5);

        Envelope requestEnvelope = envelopeDoc.getEnvelope();
        XmlObject[] childElements = XmlBeanUtils.getChildElements(requestEnvelope.getBody());
        SetTerminationTimeDocument.SetTerminationTime childElement = (SetTerminationTimeDocument.SetTerminationTime) childElements[0];
        childElement.setRequestedTerminationTime(instance);

        System.out.println("Setting termination time on JOB: ");
        System.out.println(envelopeDoc.toString());
        response = sendJobRequest( envelopeDoc );
        assertTrue(response.indexOf("SetTerminationTimeResponse") > -1);

    }
View Full Code Here

    }

    public void testSendDocument_SCENARIO_E_CONTINUED() throws IOException
    {
        String response = createJob();
        EnvelopeDocument responseEnvelope = loadResponseEnvelope(response);
        setJobURL(responseEnvelope);

        EnvelopeDocument envelopeDocument = loadDocument("SendDocument.soap");
        addReferencePropsToEnvelope(envelopeDocument, getJobEndpointReference(responseEnvelope).getReferenceProperties());
        response = sendJobRequest( envelopeDocument);
        assertTrue(response.indexOf("CreationResponse") > -1);
        assertTrue(response.indexOf("successful-ok") > -1);
    }
View Full Code Here

        createPrinter();//create printer
        testUpdateResourceProperties_SCENARIO_B1();//set accepting job state to true
        String response = sendPrinterRequest("Set_UpdateDocFormat.soap");
        response = createJob(); //create Job

        EnvelopeDocument responseEnvelope = loadResponseEnvelope(response);
        setJobURL(responseEnvelope);

        EnvelopeDocument setTerminationDoc = loadDocument("SetTerminationTime.soap");
        addReferencePropsToEnvelope(setTerminationDoc, getJobEndpointReference(responseEnvelope).getReferenceProperties());
        Calendar newTermTime = Calendar.getInstance();
        newTermTime.set(Calendar.MINUTE, newTermTime.get(Calendar.MINUTE) + 1);

        System.out.println("Setting termination time on JOB: ");
        Envelope requestEnvelope = setTerminationDoc.getEnvelope();
        XmlObject[] termElems = XmlBeanUtils.getChildElements(requestEnvelope.getBody());
        SetTerminationTimeDocument.SetTerminationTime childElement = (SetTerminationTimeDocument.SetTerminationTime) termElems[0];
        childElement.setRequestedTerminationTime(newTermTime);
        response = sendJobRequestsetTerminationDoc );

        //send a document
        EnvelopeDocument envelopeDocument = loadDocument("SendDocument.soap");
        addReferencePropsToEnvelope(envelopeDocument, getJobEndpointReference(responseEnvelope).getReferenceProperties());
        response = sendJobRequestenvelopeDocument );
        assertTrue(response.indexOf("Fault") == -1);

        try
View Full Code Here

    //***** end tests ********

    private String sendPrinterRequest(String fileName) throws IOException
    {
        EnvelopeDocument envelopeDocument = loadDocument(fileName);
        addReferencePropsToEnvelope(envelopeDocument, m_printerReferenceProperties);
        return sendRequest(m_printerURL, envelopeDocument.newInputStream());
    }
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.