我需要开发一个SOAP Web服务代理,它将来自其他源的SOAP客户端请求定向到外部应用程序。但是,我的流程失败并出现错误。请帮忙。
My Mule Flow:
> <?xml version="1.0" encoding="UTF-8"?>
>
> <mule xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml"
> xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking"
> xmlns:https="http://www.mulesoft.org/schema/mule/https"
> xmlns:http="http://www.mulesoft.org/schema/mule/http"
> xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
> xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
> xmlns:ajax="http://www.mulesoft.org/schema/mule/ajax"
> xmlns="http://www.mulesoft.org/schema/mule/core"
> xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
> xmlns:spring="http://www.springframework.org/schema/beans"
> version="EE-3.4.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http
> http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
> http://www.mulesoft.org/schema/mule/cxf
> http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
> http://www.mulesoft.org/schema/mule/vm
> http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-current.xsd
> http://www.mulesoft.org/schema/mule/core
> http://www.mulesoft.org/schema/mule/core/current/mule.xsd
> http://www.mulesoft.org/schema/mule/ajax
> http://www.mulesoft.org/schema/mule/ajax/current/mule-ajax.xsd
> http://www.mulesoft.org/schema/mule/https
> http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd
> http://www.mulesoft.org/schema/mule/ee/tracking
> http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
> http://www.mulesoft.org/schema/mule/xml
> http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd">
> <spring:beans>
> <spring:bean id="INBean" name="INBean" class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
> <spring:bean id="OUTBean" name="OUTBean" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
> </spring:beans>
> <https:connector name="HTTP_HTTPS" cookieSpec="netscape" validateConnections="true" sendBufferSize="0" receiveBufferSize="0"
> receiveBacklog="0" clientSoTimeout="100000" serverSoTimeout="100000"
> socketSoLinger="0" doc:name="HTTP\HTTPS">
> <https:tls-server path="TestTrustStore" storePassword="test"/>
> </https:connector>
>
> <flow name="WebserviceClientFlow1" doc:name="WebserviceClientFlow1">
> <http:inbound-endpoint exchange-pattern="request-response" doc:name="HTTP" address="http://localhost:8989/accountviews.asmx">
> <cxf:proxy-service payload="envelope" doc:name="SOAP" service = "AccountViews" wsdlLocation= "src/main/resources/AccountView.wsdl" enableMuleSoapHeaders="false"
> namespace="http://AccountView.namespace.com" >
> <cxf:inInterceptors>
> <spring:ref bean="INBean"/>
> </cxf:inInterceptors>
> <cxf:outInterceptors>
> <spring:ref bean="OUTBean"/>
> </cxf:outInterceptors>
> </cxf:proxy-service>
> </http:inbound-endpoint>
> <copy-properties propertyName="SOAPAction" />
> <https:outbound-endpoint exchange-pattern="request-response" address="https://externalurl/accountviews.asmx"
> responseTimeout="20000" connector-ref="HTTP_HTTPS" doc:name="HTTP"
> encoding="UTF-8">
> <cxf:proxy-client payload="envelope" enableMuleSoapHeaders="false" doc:name="SOAP"/>
> </https:outbound-endpoint>
> </flow> </mule>
我收到以下错误:
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=https://esomething/accountviews.asmx, connector=HttpsConnector
{
name=HTTP_HTTPS
lifecycle=start
this=b6a6597
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[https]
serviceOverrides=<none>
}
, name='endpoint.https.esomething.accountviews.asmx', mep=REQUEST_RESPONSE, properties={}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=20000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: PostMethod</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
我可以在调用HTTP端点时查看WSDL。但是当我发送实际的肥皂请求时,我收到上述错误。我查看过这篇文章Why the address of outbound after using CXF-Proxy isn't redirected in mule?,解决方案似乎对我不起作用。请帮忙。
错误日志:
Exception stack is:
1. Read timed out (java.net.SocketTimeoutException)
java.net.SocketInputStream:-2 (null)
2. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=https://**********/accountviews.asmx, connector=HttpsConnector
{
name=HTTP_HTTPS
lifecycle=start
this=b6a6597
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[https]
serviceOverrides=<none>
}
, name='endpoint.https.*********.accountviews.asmx', mep=REQUEST_RESPONSE, properties={}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=20000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: PostMethod (org.mule.api.transport.DispatchException)
org.mule.transport.http.HttpClientMessageDispatcher:155 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:422)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
WARN 2014-01-09 08:46:45,150 [[testproxy1].connector.http.mule.default.receiver.02] org.apache.cxf.phase.PhaseInterceptorChain: Interceptor for {http://AccountViews.secure.themembersgroup.com}AccountViews has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=https://********/accountviews.asmx, connector=HttpsConnector
{
name=HTTP_HTTPS
lifecycle=start
this=b6a6597
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[https]
serviceOverrides=<none>
}
, name='endpoint.https.*********.accountviews.asmx', mep=REQUEST_RESPONSE, properties={}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=20000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: PostMethod
at org.mule.module.cxf.MuleInvoker.invoke(MuleInvoker.java:117)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:123)
at org.mule.module.cxf.CxfInboundMessageProcessor.sendToDestination(CxfInboundMessageProcessor.java:295)
at org.mule.module.cxf.CxfInboundMessageProcessor.process(CxfInboundMessageProcessor.java:136)
at org.mule.module.cxf.config.FlowConfiguringMessageProcessor.process(FlowConfiguringMessageProcessor.java:52)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
at org.mule.processor.chain.SimpleMessageProcessorChain.doProcess(SimpleMessageProcessorChain.java:47)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:54)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:26)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:70)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:65)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
at org.mule.processor.chain.SimpleMessageProcessorChain.doProcess(SimpleMessageProcessorChain.java:47)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:54)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:70)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:26)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:70)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:61)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:47)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:65)
at org.mule.transport.AbstractMessageReceiver.routeEvent(AbstractMessageReceiver.java:473)
at org.mule.transport.AbstractTransportMessageProcessTemplate.routeEvent(AbstractTransportMessageProcessTemplate.java:84)
at org.mule.execution.FlowProcessingPhase$1$1.process(FlowProcessingPhase.java:75)
at org.mule.execution.FlowProcessingPhase$1$1.process(FlowProcessingPhase.java:64)
at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:20)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:34)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:18)
at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:58)
at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:48)
at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:54)
at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:44)
at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:44)
at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:52)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:32)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:17)
at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:113)
at org.mule.execution.FlowProcessingPhase$1.run(FlowProcessingPhase.java:63)
at org.mule.work.WorkerContext.run(WorkerContext.java:311)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:422)
答案 0 :(得分:1)
我与此问题联系了MuleSoft支持并解决了问题。他们让我在jaxws-client组件之后添加一个DOM-XML转换器,如下所示: 在此添加之后,我开始从服务器接收响应。