Web services 在camel cxf webservice的响应中创建自定义SoapFault错误消息
我正在开发一个基于camel的cxfwebservice。我必须在我的响应中显示所有类型的错误消息,我在服务层中做得很好。但是,如果一个请求仍然无效,我会得到正确的响应 对于以下类型的请求Web services 在camel cxf webservice的响应中创建自定义SoapFault错误消息,web-services,soap,apache-camel,cxf,Web Services,Soap,Apache Camel,Cxf,我正在开发一个基于camel的cxfwebservice。我必须在我的响应中显示所有类型的错误消息,我在服务层中做得很好。但是,如果一个请求仍然无效,我会得到正确的响应 对于以下类型的请求 <soapenv:Body> ... <!--Optional:--> <prod:CandidateMaximumQuantity/> <!--Optional:--> <prod:CandidatePerPage
<soapenv:Body>
...
<!--Optional:-->
<prod:CandidateMaximumQuantity/>
<!--Optional:-->
<prod:CandidatePerPageMaximumQuantity>100</prod:CandidatePerPageMaximumQuantity>
<!--Optional:-->
<prod:CandidateDisplayStartSequenceNumber>1</prod:CandidateDisplayStartSequenceNumber>
...
</soapenv:Body>
...
100
1.
...
在soap验证程序中,我得到的十进制值无效。至少应为一位数字。
在我的cxf上下文中编写了以下代码之后,我就能够进行输入请求验证了
但在回答中我
<cxf:properties>
<entry key="allowStreaming" value="false" />
<entry key="schema-validation-enabled" value="${isSchemaValidationEnabled}" />
</cxf:properties>
其中isSchemaValidationEnabled=true
因此,我在soapui中得到了以下响应
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Unmarshalling Error: cvc-datatype-valid.1.2.1: '' is not a valid value for 'integer'.</faultstring>
</soap:Fault>
</soap:Body>
soap:客户端
解组错误:cvc数据类型有效。1.2.1:“”不是“整数”的有效值。
我的要求是创建自定义错误消息,以便我可以将SOAP错误传播到我的响应中
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<prod:Response ServiceVersionNumber=" " xmlns:prod="****">
<prod:TransactionDetail>
<prod:ApplicationTransactionID>***Request</prod:ApplicationTransactionID>
<prod:ServiceTransactionID/>
<prod:TransactionTimestamp>2015-05-05T05:33:52</prod:TransactionTimestamp>
</prod:TransactionDetail>
<prod:TransactionResult>
<prod:SeverityText>Error</prod:SeverityText>
<prod:ResultID>CM018</prod:ResultID>
<prod:ResultText>No candidates resulted for the given input criteria.</prod:ResultText>
<prod:ResultMessage>
<prod:ResultDescription>List of service interface is not available for the given Service name or Service Version number</prod:ResultDescription>
</prod:ResultMessage>
</prod:TransactionResult>
</prod:Response>
***请求
2015-05-05T05:33:52
错误
CM018
没有符合给定输入标准的候选人。
服务接口列表对于给定的服务名称或服务版本号不可用
请有人回答这个问题