Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

soapfaultexception

 
gilbert engle
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[service side code]
QName faultCode = new QName("http://127.0.0.1:8888/axis2/services/HelloWorldServices15", "Server.Fault");
String faultString = "this is my fault";
String faultActor = "http://127.0.0.1:8888/axis2/services/HelloWorldServices15";
Detail faultDetail = SOAPFactory.newInstance().createDetail();
faultDetail.addChildElement("ErrorMessage").addTextNode(faultString);
faultDetail.addChildElement("ErrorCode").addTextNode("Server.Fault");

throw new SOAPFaultException(faultCode, faultString, faultActor, faultDetail); // exception with Details

SOAP message includes faultString but no details (AXIS2, Tomcat)

<soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>this is my fault</faultstring><detail /></soapenv:Fault></soapenv:Body>

faultCode at the client side is not what I specified in the service code. faultActor arrives as null. It seems that the use of SOAPFaultException does not work, except for the faultMessage, which you can specify with any thrown Exception from the service side

Any ideas as to what I am misunderstanding?

gratzi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic