【发布时间】:2014-04-10 18:04:59
【问题描述】:
我是 Mule 的新手,...我有一个 Web 服务,它有以下请求:-
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://services.test.com/schema/MainData/V1">
<soapenv:Header/>
<soapenv:Body>
<v1:insertDataRequest>
<v1:Id>6</v1:Id>
<v1:Name>abc</v1:Name>
<v1:Age>4</v1:Age>
<v1:Designation>SE</v1:Designation>
</v1:insertDataRequest>
</soapenv:Body>
</soapenv:Envelope>
我的骡流有点像以下:-
<flow name="MuleDbInsertFlow1" doc:name="MuleDbInsertFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8082" path="mainData" doc:name="HTTP"/>
<cxf:jaxws-service serviceClass="com.test.services.v1.GetCalculation" doc:name="SOAP"/>
<component class="com.test.services.v1.GetCalculationImpl" doc:name="Java"/>
<catch-exception-strategy doc:name="Catch Exception Strategy">
<set-payload value="Error occoured!!!!" doc:name="Set Payload"/>
</catch-exception-strategy>
</flow>
现在我的问题是在 SOAP 请求中,ID 和 AGE 属性是整数,如果我输入任何字符串值,如 <v1:Id>aaaa</v1:Id>,它会抛出错误,如 org.apache.cxf.interceptor.Fault: Unmarshalling Error:不是一个很自然的数字...现在我该如何处理这个Unmarshalling error 并发送自定义消息作为响应...我尝试在Mule 中使用catch 异常块,但我无法处理这个CXF 解组错误
【问题讨论】:
标签: xml soap cxf mule mule-studio