1. John Killeen
  2. PowerBuilder
  3. Thursday, 24 October 2019 10:44 AM UTC

Hi,

I am looking to upgrade my environment to PB 2019 from PB 10.5 and i have to migrate some third party product that is currently integrated into the applications. The new environment will use SOAP calls a few functions. Currently I can use 2 web service datawindows for a couple of the SOAP calls and they are working fine. For a third call the parameters are complex so I cant use a datawindow (i get "An invalid resultset parameter type was detected" error if I try to use a datawindow).

Reading some articles online many suggest using a Web Service Proxy Object or a .NET Web Service object - but these are obsolete in PB 2019 so it seems my only option is Httpclient.

I have the following code to use the Httpclient. I am trying a very simple call first before I tackle the more complex call. I get an OK status code (200) back but when the GetResponseBody call is returning the contents of the WSDL file in the ls_data variable. It should be returning a list of client (as the datawindow does).

I can t see what I am doing wrong here. I tested the calls out in SOAPUI and the work fine there. I copied the ls_body part from the SOAP UI app and that seems to match what is expected. Any help greatly appreciated.

 

Integer li_ret , li_StatusCode
String ls_data
String ls_body
String ls_ret

is_URL = 'http://appsncs1:1670/?csr_search.wsdl'         

ls_body = ''+&
 ''+&
' '+&
' '+&
' '+&
' MARY KELLY'+&
' FLYNN'+&
'
'+&
'
'+&
'
'

ihc_iir.sendrequest('POST',is_url,ls_body)

li_StatusCode = ihc_iir.GetResponseStatusCode()

ls_ret = ihc_iir.GetResponseStatusText( )

li_ret = ihc_iir.GetResponseBody(ls_data)

Return li_ret

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 24 October 2019 18:47 PM UTC
  2. PowerBuilder
  3. # 1

Hi John;

  You can call a SOAP web Service via the HTTPClient object class but, the response could just be un-marshalled XML. The original SOAP WS feature in PB would have parsed out the XML datum for you but using the HTTPClient object, you would now have to do your own parsing in your App via the PBDOM object.

Regards ... Chris

Comment
There are no comments made yet.
John Killeen Accepted Answer Pending Moderation
  1. Thursday, 24 October 2019 20:59 PM UTC
  2. PowerBuilder
  3. # 2

Thanks for the reply Chris. 

I dont mind getting unmarshallled XML back but I am not getting any results from my search. I would have expected the same list of clients that the datawindow returns but in XML format. What is coming back is just the entire contents of the .wsdl file that is being used. Are those the correct functions that I am calling?

Thanks

 

Comment
  1. Tom Jiang @Appeon
  2. Friday, 25 October 2019 05:54 AM UTC
  1. Helpful
  1. John Killeen
  2. Friday, 25 October 2019 08:32 AM UTC
Thanks Tom. I did see that post already. What I am unsure about is what the difference is in the XML between 'soap', 'soapenv', 'soap12'.

Should I be updating my XML format to match what is used in that post.
  1. Helpful
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Thursday, 24 October 2019 21:06 PM UTC
  2. PowerBuilder
  3. # 3

Hi John,

you forgot to inform the server what kind of request content you are submitting. Specify

ihc_iir.SetRequestHeader("Content-Type", "text/xml")

before you send the SendRequest().

Best,

.m

 

P.S.

FYI I will give a presentation on using HTTPclient with SOAP WS next week at Elevate. If you happen to be around...

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 24 October 2019 21:07 PM UTC
  2. PowerBuilder
  3. # 4

   Looks like its because your URL currently requests the WSDL and does not point to the WS method name itself. For example, it should be something like: http://localhost/OES_Service/nc_oes_interface.asmx/of_login_validate.  Your URL uses the WSDL extension not a method name from what I can see of your posted code.

Comment
There are no comments made yet.
John Killeen Accepted Answer Pending Moderation
  1. Thursday, 24 October 2019 22:40 PM UTC
  2. PowerBuilder
  3. # 5

Thanks Marco, I actually had that line in the constructor event of the object so am calling it. 

I moved it to the function call anyway but it has made no difference. Still just getting the contents of the wsdl file returned instead of a result set. Will try a different SOAP call to see if i have any luck there.

Rgds

John

Comment
There are no comments made yet.
John Killeen Accepted Answer Pending Moderation
  1. Thursday, 24 October 2019 22:47 PM UTC
  2. PowerBuilder
  3. # 6

Text of the body below - hopefully it displays this time. have left out the +& from end of each line

ls_body = ''
' '
' '
' '
' MARY KELLY'
' FLYNN'
'
'
'
'
'
'

Comment
There are no comments made yet.
John Killeen Accepted Answer Pending Moderation
  1. Thursday, 24 October 2019 22:49 PM UTC
  2. PowerBuilder
  3. # 7

Comment
There are no comments made yet.
John Killeen Accepted Answer Pending Moderation
  1. Tuesday, 29 October 2019 15:28 PM UTC
  2. PowerBuilder
  3. # 8

Think I found the issue.

I changed the URL from 

is_URL = 'http://appsncs1:1670/?csr_search.wsdl'       

to

is_URL = 'http://appsncs1:1670/csr_search'         

and am now getting results back.

Thanks for all your help

Rgds

John

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.