When I use HTTP outbound endpoint (Mule 3.3.1) like this in my sub flow:
<http:outbound-endpoint exchange-pattern="request-response" host="www.myhost.com" port="80" path="SOMESERVICE.asmx?wsdl" contentType="text/xml" method="GET"/>
or
<http:outbound-endpoint exchange-pattern="request-response" address="www.myhost.com:80/SOMESERVICE.asmx?wsdl" contentType="text/xml" method="GET"/>
I will get a 404 in case of service not found on that path. This is handle in the flow based on the http status 404. When the flow finishes I get this exception (in three parts, because the complete stack trace is to long for StackOverflow) (only when the path attribute is incorrect, for incorrect host or port attributes no exception is thrown):
Part 1:
WARN 2013-04-03 12:02:48,459 [[main].connector.http.mule.default.receiver.02] org.apache.cxf.phase.PhaseInterceptorChain: Application {http://support.cxf.module.mule.org/}ProxyService has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=http://www.myhost.com:80/SOMESERVICE.asmx?wsdl, connector=HttpConnector
{
name=connector.http.mule.default
lifecycle=start
this=6215723d
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[http]
serviceOverrides=<none>
}
, name='endpoint.http.www.myhost.com.80.SOMESERVICE.asmx.wsdl', mep=REQUEST_RESPONSE, properties={wsdl=, http.method=GET}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: GetMethod
at org.mule.module.cxf.MuleInvoker.invoke(MuleInvoker.java:151)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
Part 2:
Caused by: org.mule.api.transport.DispatchException: Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=http://www.myhost.com:80/SOMESERVICE.asmx?wsdl, connector=HttpConnector
{
name=connector.http.mule.default
lifecycle=start
this=6215723d
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[http]
serviceOverrides=<none>
}
, name='endpoint.http.www.myhost.com.80.SOMESERVICE.asmx.wsdl', mep=REQUEST_RESPONSE, properties={wsdl=, http.method=GET}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: GetMethod
at org.mule.transport.http.HttpClientMessageDispatcher.doSend(HttpClientMessageDispatcher.java:278)
Part 3:
Caused by: org.mule.transport.http.HttpResponseException: Not Found, code: 404
at org.mule.transport.http.HttpClientMessageDispatcher.doSend(HttpClientMessageDispatcher.java:278)
Full configuration:
<flow name="main">
<http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:8181/my-service/v1" doc:name="HTTP"/>
<cxf:proxy-service doc:name="SOAP" wsdlLocation="classpath:my-1.0.wsdl"
namespace="http://myservice.com/wsdl/my-service/1.0" service="myService" payload="envelope"/>
<logger level="TRACE" doc:name="Payload Logger" category="main" message="Payload: #[payload:java.lang.String]"/>
<flow-ref name="ping"/>
<!-- Exception should be catched here. -->
<catch-exception-strategy doc:name="Catch Exception Strategy">
<logger message="Exception: #[payload:java.lang.String]" level="ERROR" category="main" doc:name="Logger"/>
<set-payload value="<dummy/>" doc:name="Reset Payload"/>
<mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="exception-response.xslt" doc:name="Exception Transformer">
<mulexml:context-property key="faultString" value="Unexpected Exception"/>
<mulexml:context-property key="errorCode" value="-1"/>
<mulexml:context-property key="errorMessage" value="Unexpected Exception."/>
</mulexml:xslt-transformer>
</catch-exception-strategy>
</flow>
<sub-flow name="ping">
<logger message="Request payload: #[payload:java.lang.String]" level="TRACE" category="ping" doc:name="Logger"/>
<flow-ref name="http" />
<mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" doc:name="Response Transformation" xsl-file="response.xslt"/>
<!-- Here the correct response is printed and no exception. -->
<logger message="Response payload after transformation: #[payload:java.lang.String]" level="TRACE" category="ping" doc:name="Logger"/>
</sub-flow>
<sub-flow name="http">
<logger message="Request payload: #[payload:java.lang.String]" level="TRACE" category="http" />
<http:outbound-endpoint exchange-pattern="request-response" address="www.myhost.com:80/SOMESERVICE.asmx?wsdl" contentType="text/xml" method="GET"/>
<choice doc:name="Choice">
<when expression="#[message.inboundProperties['http.status'] == 200]">
<set-payload value="<result>OK</result>" doc:name="OK"/>
</when>
<otherwise>
<set-payload value="<result>NotAvailable</result>" doc:name="NotAvailable"/>
</otherwise>
</choice>
</sub-flow>
My main flow does use catch-exception-strategy, but this doesn't catch the exception. Any idea what might be wrong?
Cheers,
Tuno