I'm using PB 11.5.1 (Build 4897). My application is getting data from
a webservice using soap connection and it works pretty well except for
Exceptions handling.
Indeed, when the request is not right, this webservice throws
exceptions.
Just like a normal result, these exceptions have a known XML format,
with properties I have to read.
But the way exceptions are currently handled in my program does not
allow me to get these properties.
I did it like in all the code examples I found, a soapexception is
catched (object created while importing pbwsclient115.pbx in PB),
something like this :
TRY
ls_result = iuo_webservice.search(ls_arguments)
CATCH (soapexception sexc)
Messagebox('Exception', sexc.getmessage()
END TRY
When an exception is throwed, the soapexception message just says
"Response is not well formed XML".
I debugged the XML response with fiddler2, and it seems fine, I can
see the different XML exceptions properties I expect.
I can't figure out how to get them in Powerbuilder as the
soapexception structure does not have the expected variables.
Moreover, when I edit the wsdl file coming with the webservice, I can
see a searchserviceexception structure, but it was not created when I
deployed the wsdl file in Powerbuilder...
How should I proceed to catch the exception throwed by the
webservice ? Should I check something ?
Thanx.
Regards,
Kiskoul
I've written a webservice call that is catching a soapexception, but it doesn't contain all the detail I need. The xml response does contain all the fault detail I want, I just can't figure out how to access it. The wsdl defines a fault, but PowerBuilder does not generate a proxy for it. I tried creating a custom exception object by inheriting from soapexception and adding the elements defined in the fault as instance variables. Then I changed my code to catch that exception, but it bypasses it in favor of the original soapexception. I don't know why it doesn't recognize my object as a soapexception.
If anyone has successfully created and mapped a custom exception to a SOAP fault, I would love to hear from you.
Thanks,Mary
Hi Mary
I saw a few days ago your thread describing the exact same problem. I
posted on it but my message never showed up...
I'm really starting to believe that Powerbuilder can't do what we
expect, which is quite problematic.
And in my case, I'm facing an additional problem, the third party that
owns the webservice has decided to compress the HTTP responses when
exceptions are thrown. It seems Powerbuilder isn't able to decompress
them, explaining the message "Response is not well formed XML" I get.
With Fiddler2 (HTTP sniffer), I can intercept the compressed
exception, decompress it, and when my application catches it, I'm
getting the contents of the <faultstring> tag (but only that, just as
you).
So if someone know how to enable HTTP decompression on Powerbuilder,
it would also be great.
Thanks,
Kiskoul
http://www.sybase.com/detail_list?id=11507&pageNum=1&multi=true&show=1248