Package org.xmlsoap.schemas.soap.envelope

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



    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

    }


    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

        try
        {
            LOG.debug( MSG.getMessage( Keys.RECEIVED_REQUEST ) );
            SOAPMessageContext soapMsgContext = (SOAPMessageContext) msgContext;
            SOAPEnvelope envelope = soapMsgContext.getMessage().getSOAPPart().getEnvelope();
            EnvelopeDocument envelopeDocXmlBean = EnvelopeDocument.Factory.parse( envelope.toString() );
            Envelope envelopeXmlBean = envelopeDocXmlBean.getEnvelope();
            Body body = envelopeXmlBean.getBody();

            ResourceContext resourceContext = createResourceContext( soapMsgContext );
            resourceContext.setProperty( SOAP_ENVELOPE_XMLBEAN, envelopeXmlBean );
            List responseBodyElems = new ArrayList();
View Full Code Here

        try
        {
            LOG.debug( MSG.getMessage( Keys.RECEIVED_REQUEST ) );
            SOAPMessageContext soapMsgContext = (SOAPMessageContext) msgContext;
            SOAPEnvelope envelope = soapMsgContext.getMessage().getSOAPPart().getEnvelope();
            EnvelopeDocument envelopeDocXmlBean = EnvelopeDocument.Factory.parse( envelope.toString() );

            if(LOG.isDebugEnabled())
            {
                LOG.debug("The request envelope: \n" + envelope.toString());
            }
            Envelope envelopeXmlBean = envelopeDocXmlBean.getEnvelope();
            Body body = envelopeXmlBean.getBody();

            ResourceContext resourceContext = createResourceContext( soapMsgContext );
            resourceContext.setProperty( SOAP_ENVELOPE_XMLBEAN, envelopeXmlBean );
            List responseBodyElems = new ArrayList();
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 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 = sendRequest(m_jobURL, destroyEnvelopeDocument.newInputStream());
        assertTrue(response.indexOf("DestroyResponse") > -1);

        //should fail
        response = sendRequest(m_jobURL, destroyEnvelopeDocument.newInputStream());
        assertTrue(response.indexOf("fault") > -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.