Skip to Content
avatar image
Former Member

Powerbuilder - Capture XML response from web service

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

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

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 09, 2017 at 01:39 AM

    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)
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Try ..

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

      - or better yet -

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

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

    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.

    Add comment
    10|10000 characters needed characters exceeded

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

    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.

    Add comment
    10|10000 characters needed characters exceeded