Listing 9. SOAP trace upon invoking sendSOAPFault() from stubs-based client.

[java] <!-------------------- REQUEST ---------------->
[java] URL: http://localhost:7001/basic_javaclass/
   HelloWorld
[java] Headers:
[java] SOAPAction: [""]
[java] Content-Type: [text/xml]

[java] <env:Envelope xmlns:env=
   "http://schemas.xmlsoap.org/soap/envelope/"
   xmlns:xsi="http://www.w3.org/2001/
   XMLSchema-instance" xmlns:soapenc=
      "http://schemas.xmlsoap.org/soap/encoding/" 
   xmlns:xsd="http://www.w3.org/2001/
      XMLSchema">
<env:Header/>
<env:Body env:encodingStyle=
   "http://schemas.xmlsoap.org/soap/encoding/">
   <m:sendSOAPFault xmlns:m=
      "http://www.bea.com/servers/wls70/samples/
      examples/webservices/basic/javaclass"/>
   </env:Body>
</env:Envelope>
[java] <!-------------------- END REQUEST ------------>
[java] <!-------------------- RESPONSE --------------->
[java] URL: http://localhost:7001/basic_javaclass/
   HelloWorld
[java] Response Code :500
[java] Headers:
[java] Date=Wed, 23 Jun 2004 21:39:06 GMT
[java] Server=WebLogic Server 8.1 SP2 Fri Dec 5 
   15:01:51 PST 2003 316284
   with CR182483
[java] Content-Length=730
[java] Content-Type=text/xml; charset=utf-8
[java] Envelope   :
[java] <?xml version="1.0" encoding="utf-8" 
   standalone="yes"?><env:Envelope
   xmlns:env="http://schemas.xmlsoap.org/soap/
   envelope/" xmlns:xsi="http://www.w3.org/2001/
   XMLSchema-instance" xmlns:soapenc=
   "http://schemas.xmlsoap.org/soap/encoding/" 
   xmlns:xsd="http://www.w3.org/2001/
   XMLSchema">
<env:Header/>
   <env:Body>
      <env:Fault>
         <faultcode>env:Server</faultcode>
         <faultstring>Service specific exception:
            examples.webservices.basic.javaclass.
            MyException
         </faultstring>
         <detail>
            <MyException xmlns:n1="java:examples.
               webservices.basic.javaclass" 
               xsi:type="n1:MyException">
               <errorId xsi:type="xsd:int">10</errorId>
               <errorMessage xsi:type="xsd:string">
                  sendSOAPFault() call fails !
               </errorMessage>
            </MyException>
         </detail>
      </env:Fault>
   </env:Body>
</env:Envelope>
[java] <!-------------------- END RESPONSE ----------->
[java] [Client] Exception caught is : MyException{ 
   errorId=<10> errorMessage=<sendSOAPFault() 
   call fails !> }
[java] [Client] errorMessage : sendSOAPFault() 
   call fails !
[java] [Client] errorId : 10
[java] [Client] Exception stack trace :
[java] MyException{ errorId=<10> 
   errorMessage=<sendSOAPFault() call fails !> }
[java] at sun.reflect.NativeConstructorAccessorImpl.
   newInstance0(Native Method)
[java] at sun.reflect.NativeConstructorAccessorImpl.
   newInstance(NativeConstructorAccessorImpl.
   java:39)
[java] at sun.reflect.
   DelegatingConstructorAccessorImpl.newInstance(
   DelegatingConstructorAccessorImpl.java:27)
[java] at java.lang.reflect.Constructor.newInstance(
   Constructor.java:274)
[java] at weblogic.xml.schema.binding.
   BeanExceptionCodecBase.invokeConstructor(
   BeanExceptionCodecBase.java:134)
[java] at weblogic.xml.schema.binding.
   BeanExceptionCodecBase.deserialize(
   BeanExceptionCodecBase.java:72)
[java] at weblogic.xml.schema.binding.RuntimeUtils.
   invoke_deserializer(RuntimeUtils.java:428)
[java] at weblogic.xml.schema.binding.RuntimeUtils.
   invoke_deserializer(RuntimeUtils.java:328)
[java] at weblogic.webservice.core.DefaultPart.
   toJava(DefaultPart.java:384)
[java] at weblogic.webservice.core.FaultMessage.
   toJava(FaultMessage.java:227)
[java] at weblogic.webservice.core.ClientDispatcher.
   deserializeFault(ClientDispatcher.java:391)
[java] at weblogic.webservice.core.ClientDispatcher.
   receive(ClientDispatcher.java:317)
[java] at weblogic.webservice.core.ClientDispatcher.
   dispatch(ClientDispatcher.java:144)
[java] at weblogic.webservice.core.DefaultOperation.
   invoke(DefaultOperation.java:457)
[java] at weblogic.webservice.core.DefaultOperation.
   invoke(DefaultOperation.java:443)
[java] at weblogic.webservice.core.rpc.
   StubImpl._invoke(StubImpl.java:290)
[java] at examples.webservices.basic.javaclass.
   HelloWorldPort_Stub.send
   SOAPFault(HelloWorldPort_Stub.java:25)
[java] at examples.webservices.basic.javaclass.
   Client.main(Client.java:35)
[java] Caused by: javax.xml.rpc.soap.
   SOAPFaultException: Service specific exception: 
   examples.webservices.basic.javaclass.MyException
[java] at weblogic.webservice.core.ClientDispatcher.
   receive(ClientDispatcher.java:313)
[java] ... 6 more