Package com.eviware.soapui.impl.wsdl.mock

Examples of com.eviware.soapui.impl.wsdl.mock.DispatchException


                }
            }

            return null;
        } catch (Throwable e) {
            throw new DispatchException(e);
        } finally {
            for (XmlCursor cursor : cursorCache.values()) {
                if (cursor != null) {
                    cursor.dispose();
                }
View Full Code Here


                scriptEngine.setScript(dispatchScript);
                Object retVal = scriptEngine.run();
                return getMockOperation().getMockResponseByName(String.valueOf(retVal));
            } catch (Throwable e) {
                SoapUI.logError(e);
                throw new DispatchException("Failed to dispatch using script; " + e);
            } finally {
                scriptEnginePool.returnScriptEngine(scriptEngine);
            }
        }
View Full Code Here

            throws DispatchException {
        XmlObject xmlObject;
        try {
            xmlObject = request.getRequestXmlObject();
        } catch (XmlException e) {
            throw new DispatchException("Error getting XmlObject for request: " + e);
        }

        String path = getMockOperation().getScript();
        if (StringUtils.isNullOrEmpty(path)) {
            throw new DispatchException("Missing dispatch XPath expression");
        }

        String[] values = XmlUtils.selectNodeValues(xmlObject, path);
        for (String value : values) {
            MockResponse mockResponse = getMockOperation().getMockResponseByName(value);
View Full Code Here

                    }
                }
            }
        }

        throw new DispatchException("Missing operation for soapAction [" + soapAction + "] and body element ["
                + contentQName + "] with SOAP Version [" + soapVersion + "]");
    }
View Full Code Here

                    }
                }
            }
        }

        throw new DispatchException("Missing response operation for soapAction [" + soapAction + "] and body element ["
                + contentQName + "] with SOAP Version [" + soapVersion + "]");
    }
View Full Code Here

        return mockResponse;
    }

    public RestMockResult dispatchRequest(RestMockRequest request) throws DispatchException {
        if (getMockResponseCount() == 0) {
            throw new DispatchException("Missing MockResponse(s) in MockOperation [" + getName() + "]");
        }

        try {
            RestMockResult result = new RestMockResult(request);

            MockResponse mockResponse = getDispatcher().selectMockResponse(request, result);

            result.setMockResponse(mockResponse);

            result.setMockOperation(this);

            if (mockResponse == null) {
                mockResponse = getMockResponseByName(this.getDefaultResponse());
            }

            if (mockResponse == null) {
                throw new DispatchException("Failed to find MockResponse");
            }

            result.setMockResponse(mockResponse);
            mockResponse.execute(request, result);

            return result;
        } catch (Exception e) {
            throw new DispatchException(e);
        }
    }
View Full Code Here

                    }
                }

                if (wsdlMockRunners != null) {
                    try {
                        DispatchException ex = null;
                        MockResult result = null;

                        for (MockRunner wsdlMockRunner : wsdlMockRunners) {
                            if (!wsdlMockRunner.isRunning()) {
                                continue;
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.mock.DispatchException

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.