Package com.eviware.soapui.impl.wsdl.submit.transports.http

Examples of com.eviware.soapui.impl.wsdl.submit.transports.http.WsdlResponse


        testStepResult.startTimer();
        runContext.setProperty(AssertedXPathsContainer.ASSERTEDXPATHSCONTAINER_PROPERTY, testStepResult);

        try {
            submit = testRequest.submit(runContext, false);
            WsdlResponse response = (WsdlResponse) submit.getResponse();

            if (submit.getStatus() != Submit.Status.CANCELED) {
                if (submit.getStatus() == Submit.Status.ERROR) {
                    testStepResult.setStatus(TestStepStatus.FAILED);
                    testStepResult.addMessage(submit.getError().toString());

                    testRequest.setResponse(null, runContext);
                } else if (response == null) {
                    testStepResult.setStatus(TestStepStatus.FAILED);
                    testStepResult.addMessage("Request is missing response");

                    testRequest.setResponse(null, runContext);
                } else {
                    runContext.setProperty(AssertedXPathsContainer.ASSERTEDXPATHSCONTAINER_PROPERTY, testStepResult);
                    testRequest.setResponse(response, runContext);

                    testStepResult.setTimeTaken(response.getTimeTaken());
                    testStepResult.setSize(response.getContentLength());

                    switch (testRequest.getAssertionStatus()) {
                        case FAILED:
                            testStepResult.setStatus(TestStepStatus.FAILED);
                            break;
                        case VALID:
                            testStepResult.setStatus(TestStepStatus.OK);
                            break;
                        case UNKNOWN:
                            testStepResult.setStatus(TestStepStatus.UNKNOWN);
                            break;
                    }

                    testStepResult.setResponse(response, testStepResult.getStatus() != TestStepStatus.FAILED);
                }
            } else {
                testStepResult.setStatus(TestStepStatus.CANCELED);
                testStepResult.addMessage("Request was canceled");
            }

            if (response != null) {
                testStepResult.setRequestContent(response.getRequestContent(),
                        testStepResult.getStatus() != TestStepStatus.FAILED);
            } else {
                testStepResult.setRequestContent(testRequest.getRequestContent(),
                        testStepResult.getStatus() != TestStepStatus.FAILED);
            }
View Full Code Here


        WsdlMockResponse mockResponse = mockOperation.addNewMockResponse(
                "Response " + (1 + mockOperation.getMockResponseCount()), false);

        // add expected response if available
        if (request != null && request.getResponse() != null) {
            WsdlResponse response = request.getResponse();
            mockResponse.setResponseContent(response.getContentAsString());

            Attachment[] attachments = response.getAttachments();
            for (Attachment attachment : attachments) {
                mockResponse.addAttachment(attachment);
            }

            if (mockResponse.getResponseHeaders() != null && mockResponse.getResponseHeaders().size() > 0
                    && UISupport.confirm("Add current Response HTTP Headers to MockResponse", title)) {
                mockResponse.setResponseHeaders(response.getResponseHeaders());
            }
        } else {
            mockResponse.setResponseContent(request.getOperation().createResponse(true));
        }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.submit.transports.http.WsdlResponse

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.