Skip to Content
0

Powerbuilder - Capture XML response from web service

Sep 08, 2017 at 07:37 PM

117

avatar image
Former Member

We are using PB 12.6. We use SOAP to call a web service and the response is an nvo (generated via Proxy Wizard from WSDL). Is there a way within PB to see the XML or convert the nvo to XML format? I use Fiddler to see the raw XML request/response but need to be able to capture it in the code.

Thanks.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

avatar image
Former Member Sep 08, 2017 at 08:28 PM
0

Hi Laura;

AFAIK that capability is not there in PB <= 12.6 versions.

Suggestion: How about turning on "Soap logging" and have the PB App read its own SOAP log for that info?

FYI: See the SetOptions (string options) method ... option: SoapLog

HTH

Regards ... Chris

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Sep 09, 2017 at 01:39 AM
0

That would be a great solution. I quickly tried to use both SetOptions and SetSoapLogFile but both end up just creating empty files. Do I need to do anything else to populate that log? I did some searching for info about these options but did not find much.

Here is the code:

c_soapconnection = CREATE SoapConnection
c_soapconnection.SetOptions("SoapLog=~"c:\\soaplog.txt~"")

TRY
li_ReturnCode = c_soapconnection.CreateInstance(px_BridgerService, "p_cst_bridger_basichttpbinding_isearch", ls_BridgerEndPoint)

catch (soapexception e)
messagebox("soapexception:",e.getmessage())
catch (runTimeError e1)
messagebox("RuntimeError:",e1.getmessage())
end try

p_SearchResponse = px_BridgerService.Search(px_BridgerHeader, p_PredefinedSearch,p_SearchRequest)
Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Try ..

SetOptions ( ' SoapLog="c:/soaplog.txt" ' )

- or better yet -

SetOptions ( ' SoapLog="c:/soap/soaplog.txt" ' ) // where folder has proper permissions.

0
avatar image
Former Member Sep 09, 2017 at 02:10 AM
0

I just doublechecked and see the proxy is set up as .NET so I assume that is why the log is not actually being created. Besides using a 3rd party tool such as Fiddler to capture the traffic, which I am not allowed to use on our production system, is there any similar logging or way to capture the XML response besides parsing the NVO out myself?

Thanks again for any guidance.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Sep 09, 2017 at 02:10 AM
0

I just doublechecked and see the proxy is set up as .NET so I assume that is why the log is not actually being created. Besides using a 3rd party tool such as Fiddler to capture the traffic, which I am not allowed to use on our production system, is there any similar logging or way to capture the XML response besides parsing the NVO out myself?

Thanks again for any guidance.

Share
10 |10000 characters needed characters left characters exceeded