You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by hu...@jpmorgan.com on 2002/03/21 21:46:27 UTC

[SOLVED]: Re: Service's exception text not serialized???

I've found that the exception message string is not XML encoded.  However
it is XML decoded in the client!?!?!  This sounds like a bug to me...

Anyway, change
      throw new Exception("<init>");
to
      throw new Exception(org.apache.soap.Utils.cleanString("<init>"));
and all is well.

You don't have to XML decode in the client because it's already done!!

Shawn.



                                                                                                                                             
                                                                                                                                             
                      hughes_shawn@jpm         To:      soap-user@xml.apache.org                                                             
                      organ.com                cc:                                                                                           
                                               Subject: Service's exception text not serialized???                                           
                      03/20/2002 02:03                                                                                                       
                      PM                                                                                                                     
                      Please respond                                                                                                         
                      to soap-user                                                                                                           
                                                                                                                                             
                                                                                                                                             



My SOAP (2.2) service includes the stack trace when throwing the exception.
However the exception message is not serialized.  It is easily
reproducible, just throw an exception that contains unescaped XML
characters, e.g.

      public String getPublication(PublicationInputModel inputModel) throws
Exception {
            throw new Exception( "<init>" );
      }

The only obvious solution is to encode the string and decode it in the
client.  Has anyone else run into this problem?

Shawn.






This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan Chase & Co., its
subsidiaries and affiliates.