Package org.jboss.soa.esb.actions

Examples of org.jboss.soa.esb.actions.ActionProcessingException


        System.out.println("Received message on Topic.  Sending '" + addition + "' to " + targetService);

        try {
            getInvoker().deliverAsync(message);
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException("Failed to deliver message: " + e.getMessage());
        }

        return message;
    }
View Full Code Here


    private ServiceInvoker getInvoker() throws ActionProcessingException {
        try {
            return new ServiceInvoker(targetService);
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException("Failed to create ServiceInvoker: " + e.getMessage());
        }
    }
View Full Code Here

        Object payload;

        try {
            payload = payloadProxy.getPayload(message);
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException("Error getting SOAP message parameters from payload.", e);
        }
        catch (final ClassCastException ex)
        {
            throw new ActionProcessingException("Required a Map in the payload, but got something else!");
        }

        if (!(payload instanceof Map)) {
            throw new ActionProcessingException("Invalid payload type in message body location '" + payloadProxy.getGetPayloadLocation() + "'.  Expected 'java.util.Map', was '" + payload.getClass().getName() + "'.");
        }

        Map params = (Map) payload;
        if (params.isEmpty()) {
            logger.warn("Params Map found in message, but the map is empty.");
        }

        String request;
        try {
            request = soapUIInvoker.buildRequest(wsdl, getEndpointOperation(), soapServiceName, params, httpClientProps, smooksTransform, soapNs);

        } catch (IOException e) {
            throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
        } catch (SAXException e) {
            throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
        }
        Response response = invokeEndpoint(request);

        if(responseAsOgnlMap) {
            try {
                String mergedResponse = soapUIInvoker.mergeResponseTemplate(wsdl, getEndpointOperation(), soapServiceName, response.getBody(), httpClientProps, null, soapNs);
                response.setBody(mergedResponse);
            } catch (IOException e) {
                throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
            } catch (SAXException e) {
                throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
            }
        }

        // And process the response into the message...
        processResponse(message, response);
View Full Code Here

                    endpoint = soapUIInvoker.getEndpoint(wsdl, soapServiceName, httpClientProps);
                }
                contentType = soapUIInvoker.getContentType(wsdl, soapServiceName, httpClientProps) + ";charset=UTF-8";

            } catch (IOException e) {
                throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
            }
            endpointInitialized = true;
        }
        PostMethod post = new PostMethod(endpoint);

        post.setRequestHeader("Content-Type", contentType);
        post.setRequestHeader("Connection", "keep-alive");
        post.setRequestHeader("SOAPAction", "\"" + soapAction + "\"")/// Customization to add quotes to Soap action
        try {
          post.setRequestEntity(new StringRequestEntity(request, "text/xml", "UTF-8"));
            int result = httpclient.executeMethod(post);
            if(result != HttpStatus.SC_OK) {
                // TODO: We need to do more here!!

                logger.warn("Received status code '" + result + "' on HTTP SOAP (POST) request to '" + endpoint + "'.");
            }
            return new Response(post.getResponseBodyAsString(), post.getResponseHeaders(), result, post.getStatusLine().getReasonPhrase());
        } catch (IOException e) {
            throw new ActionProcessingException("Failed to invoke SOAP Endpoint: '" + endpoint + " ' - '" + soapAction + "'.", e);
        } finally {
            post.releaseConnection();
        }
    }
View Full Code Here

        }

        try {
            payloadProxy.setPayload(message, responseObject);
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException(e);
        }
       
        // JBESB-2511
        org.jboss.soa.esb.message.Properties properties = message.getProperties();
        for (Header header : response.getHeaders()) {
View Full Code Here

            Document doc = docBuilder.parse(new InputSource(new StringReader(response)));
            Element graphRootElement = getGraphRootElement(doc.getDocumentElement());

            populateResponseOgnlMap(map, graphRootElement);
        } catch (ParserConfigurationException e) {
            throw new ActionProcessingException("Unexpected DOM Parser configuration error.", e);
        } catch (SAXException e) {
            throw new ActionProcessingException("Error parsing SOAP response.", e);
        } catch (IOException e) {
            throw new ActionProcessingException("Unexpected error reading SOAP response.", e);
        }

        return map;
    }
View Full Code Here

            {
                if (logger.isDebugEnabled())
                {
                    logger.debug("Exception thrown from wsMethod invocation", e) ;
                }
                throw new ActionProcessingException("Could not call method" + operationName, e);
            }
            return mapResponseToMessage(message, result, smooksResponseMapper);
        }
        finally
        {
View Full Code Here

            {
                client = new WSDynamicClientFactory().create(wsdl, serviceName, username, password);
            }
            catch (final WiseException e)
            {
                throw new ActionProcessingException(e.getMessage(), e);
            }
            // Force endpoints to prevent JBossWS concurrency issues
            getEndpoints(client) ;
        }
        return client;
View Full Code Here

        {
            return payloadProxy.getPayload(message);
        }
        catch (final MessageDeliverException e)
        {
            throw new ActionProcessingException("Could not locate SOAP message parameters from payload", e);
        }
    }
View Full Code Here

        {
            throw re ;
        }
        catch (final Exception ex)
        {
            throw new ActionProcessingException("Unexpected exception while adding smooks handlers", ex) ;
        }
        finally
        {
            if (cleanup)
            {
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.actions.ActionProcessingException

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.