code_junkie

spring & web service client - Fault Detail

Nov 11th, 2011
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. WebServiceTemplate ws = new WebServiceTemplate();
  2. ws.setMarshaller(client.getMarshaller());
  3. ws.setUnmarshaller(client.getUnMarshaller());
  4. try {
  5. MyResponse resp = (MyResponse) = ws.marshalSendAndReceive(WS_URI, req);
  6. } catch (SoapFaultClientException e) {
  7. SoapFault fault = e.getSoapFault();
  8. SoapFaultDetail details = e.getSoapFault().getFaultDetail();
  9. //details always NULL ? Bug?
  10. }
  11.  
  12. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  13. <soapenv:Body>
  14. <soapenv:Fault>
  15. <faultcode>soapenv:Client</faultcode>
  16. <faultstring>Validation error</faultstring>
  17. <faultactor/>
  18. <detail>
  19. <ws:ValidationError xmlns:ws="http://ws.x.y.com">ERR_UNKNOWN</ws:ValidationError>
  20. </detail>
  21. </soapenv:Fault>
  22. </soapenv:Body>
Add Comment
Please, Sign In to add comment