Created
October 10, 2012 10:23
-
-
Save ricston-git/3864598 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> | |
<soap:Body> | |
<soap:Fault> | |
<faultcode>soap:Client</faultcode> | |
<faultstring>Schema validation error on message from client: "?" does not satisfy the "int" type.</faultstring> | |
<detail> | |
<error-reply> | |
<error>Contact the administrator</error> | |
<ExternalReferenceNumber>321</ExternalReferenceNumber> | |
<PartnerID>123</PartnerID> | |
</error-reply> | |
</detail> | |
</soap:Fault> | |
</soap:Body> | |
</soap:Envelope> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FaultInterceptor extends AbstractSoapInterceptor { | |
public FaultInterceptor() { | |
super(Phase.MARSHAL); | |
} | |
@Override | |
public void handleMessage(SoapMessage message) throws Fault { | |
Fault fault = (Fault) message.getContent(Exception.class); | |
if (fault.getCode() != null && fault.getCode().equals("READ_VALIDATION_ERROR")) { | |
Element detail = fault.getOrCreateDetail(); | |
Element errorDetail = detail.getOwnerDocument().createElement("error-reply"); | |
Element error = errorDetail.getOwnerDocument().createElement("error"); | |
Element extRefNumber = errorDetail.getOwnerDocument().createElement("ExternalReferenceNumber"); | |
Element partnerId = errorDetail.getOwnerDocument().createElement("PartnerID"); | |
partnerId.setTextContent("123"); | |
extRefNumber.setTextContent("321"); | |
error.setTextContent("Contact the administrator"); | |
errorDetail.appendChild(error); | |
errorDetail.appendChild(extRefNumber); | |
errorDetail.appendChild(partnerId); | |
detail.appendChild(errorDetail); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" | |
xmlns:mule="http://ricston.com/"> | |
<soapenv:Header/> | |
<soapenv:Body> | |
<mule:add> | |
<arg0>9</arg0> | |
<arg1>?</arg1> | |
</mule:add> | |
</soapenv:Body> | |
</soapenv:Envelope> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="proxy-service-validation"> | |
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" | |
path="proxy-service-validation"/> | |
<cxf:proxy-service validationEnabled="true" wsdlLocation="service.wsdl" service="MyService" | |
payload="envelope" namespace="http://ricston.com/"> | |
<cxf:outFaultInterceptors> | |
<spring:bean class="com.ricston.proxyvalidation.FaultInterceptor"/> | |
</cxf:outFaultInterceptors> | |
</cxf:proxy-service> | |
... | |
</flow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="proxy-service-validation"> | |
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" | |
path="proxy-service-validation"/> | |
<cxf:proxy-service validationEnabled="true" wsdlLocation="service.wsdl" service="MyService" | |
payload="envelope" namespace="http://ricston.com/"/> | |
... | |
</flow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> | |
<soap:Body> | |
<soap:Fault> | |
<faultcode>soap:Client</faultcode> | |
<faultstring>Schema validation error on message from client: "?" does not satisfy the "int" type </faultstring> | |
</soap:Fault> | |
</soap:Body> | |
</soap:Envelope> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment