<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
I am currently working on an old legacy system that is using jax-rpc.&nbsp; I would like to add in some custom faults such that I can inform clients better.&nbsp; I.E. I can throw custom exceptions/faults such that the user can catch them to determine the best course of action.&nbsp; However using JBoss I have not been able to get this to work.&nbsp; The main problem is that in the SOAP message that comes back there is no &lt;detail&gt; tag.&nbsp; This tag is how the exception would get deserialized on the client, so without that tag the client will have no idea what exception/fault was thrown.<br><br>Has anyone every gotten a custom fault to work with JBoss?&nbsp; My guess is no as I have not been able to find out anything on this problem.<br><br>I am running 4.2.3.GA and out of the box is has jbossws-native-3.0.1, I also installed jbossws-native-3.1.1.GA to see if it fixed the problem but I was still out of luck.&nbsp; Please help I am all out of ideas!&nbsp; Below are some code snippets to show what I am talking about.&nbsp; If you need more please let me know.<br><br>I took a simple example jax-rpc HelloWord service from the java tutorial section and added a fault to the wsdl.<br><br>Here is a snippet:<br>&nbsp; &lt;portType name="HelloIF"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;operation name="sayHello" parameterOrder="String_1"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input message="tns:HelloIF_sayHello"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;output message="tns:HelloIF_sayHelloResponse"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;fault name="fault" message="tns:sayHelloException"&gt;&lt;/fault&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/operation&gt;<br>&nbsp; &lt;/portType&gt; <br><br>I generated the jax-rpc classes:<br>&nbsp;<br>Here is the fault/exception generated:<br>public class SayHelloException extends java.lang.Exception {<br>&nbsp;&nbsp;&nbsp; private java.lang.String message;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; public SayHelloException(java.lang.String message) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super(message);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.message = message;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; public java.lang.String getMessage() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return message;<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>Here is the endpoint interface:<br>public interface HelloIF extends java.rmi.Remote {<br>&nbsp;&nbsp;&nbsp; public java.lang.String sayHello(boolean string_1) throws <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; samples.webservices.jaxrpc.simple.SayHelloException,&nbsp; java.rmi.RemoteException;<br>}<br><br>I also creating the jax-rpc mapping file and deployed with the war in the web-inf directory as well as my webservices.xml and web.xml.<br><br>At this point I am not sure why jboss is not creating the &lt;detail&gt; tag in the SOAP message that gets sent back to the server.<br><br>Here is how I throw the custom exception on the server:<br>throw new SayHelloException("Throwing custom exception/fault from WS");<br><br>Here is my client:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Stub stub = (Stub) port;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8080/hello/simple"); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String result = port.sayHello(true);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(result);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch (SayHelloException ex) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("PASS! caught a custom exception");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch (RemoteException ex) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch (Exception ex) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("FAIL! caught a Exception");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>                                               <br /><hr />Windows 7: It works the way you want. <a href='http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen2:102009' target='_new'>Learn more.</a></body>
</html>