2015-05-13 70 views
0

您好我正在玩SOAP请求,我遇到了cxf代理客户端的问题。我基本上发送肥皂请求到http端点,删除SOAP信封,然后尝试将其添加回代理客户端。如何正确配置mule cxf代理客户端

我期待得到一个无法回应的回应(因为我删除了wsse头文件)。

然而,我得到以下SOAP响应:“映射为失败消息有效载荷响应代码500的类型为:BufferInputStream” 和控制台记录以下(注意这仅是它的开始)

WARN 2015-05-13 12:38:28,886 [[sandbox2] .HTTP_Listener_Configuration.worker.01] org.apache.cxf.phase.PhaseInterceptorChain:Interceptor for {http://support.cxf.module.mule.org/} ProxyService#{http://support.cxf.module.mule.org/} invoke has thrown exception,unwinding now org.apache.cxf.interceptor.Fault:映射为失败的响应代码500。消息有效负载的类型为:BufferInputStream at org.mule.module.cxf.transport.MuleUniversalConduit $ 2.handleMessage(MuleUniversalConduit.java:194)〜[mule-module-cxf-3.6.1.jar:3.6.1] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)〜[cxf-api-2.5.9.jar:2.5.9] at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl。 java:531)〜[cxf-rt-core-2.5.9.jar:2.5.9] at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:462)〜[cxf-rt-core- 2.5.9.jar:2.5.9]

这里是我的流量

<?xml version="1.0" encoding="UTF-8"?> 

<mule xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" 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.6.1" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="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/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/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd"> 
    <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8086" doc:name="HTTP Listener Configuration"/> 
    <http:request-config name="HTTP_Request_Configuration" host="localhost" port="8080" basePath="my-app/RetrieveAct.svc" doc:name="HTTP Request Configuration"/> 
    <flow name="myFlow"> 
     <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/> 
     <logger message="message received #[payload] " level="INFO" doc:name="Logger"/> 
     <cxf:proxy-service namespace="PfPolicyService" payload="body" doc:name="CXF"/> 
     <logger message="#[payload]" level="INFO" doc:name="Logger"/> 
     <logger message="#[payload]" level="INFO" doc:name="Logger"/> 
     <cxf:proxy-client payload="body" doc:name="CXF"/> 
     <response> 
      <logger message="#[payload]" level="INFO" doc:name="Logger"/> 
     </response> 
     <http:request config-ref="HTTP_Request_Configuration1" path="http://localhost:8080/my-app/RetrieveAct.svc" method="POST" doc:name="HTTP"> 
      <http:request-builder> 
       <http:header headerName="soapAction" value="getUserAcct"/> 
      </http:request-builder> 
     </http:request> 
    </flow> 
</mule> 

谁能解释一下我做错了,如何纠正这个问题?

感谢

回答

0

您遇到的问题,是因为你的SOAP请求的修改最终成为一个无效的SOAP请求,因此服务器无法解析它,它返回一个500 HTTP状态代码。

您可以使用CXF的日志拦截器来检查您发送的最终结果。

0

您的骡子流似乎对我来说很重要,代理服务可能因各种原因而爆炸。

添加日志记录拦截到代理客户端,看看这是否使您能够确定问题:

<cxf:proxy-client payload="body"> 
    <cxf:inInterceptors> 
     <spring:bean class="org.apache.cxf.interceptor.LoggingInInterceptor"> 
      <spring:property name="prettyLogging" value="true" /> 
     </spring:bean> 
    </cxf:inInterceptors> 
    <cxf:outInterceptors> 
     <spring:bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"> 
      <spring:property name="prettyLogging" value="true" /> 
     </spring:bean> 
    </cxf:outInterceptors> 
</cxf:proxy-client> 

或者,使用TPCMon捕获网络流量。

在进行集成测试之前,首先设置服务模拟和适当的测试用例将是一个很好的理智检查。