1. Colin Cruikshank
  2. PowerBuilder
  3. Monday, 15 November 2021 20:34 PM UTC

Hi there,

Powerbuilder 2019 R3 build 2728.

In our application I've written a custom httpclient class that is a descendant of the standard HttpClient class. In my custom class I've put in a function that takes in, as args, the URL, Headers, Data, and method (post or get or put or delete etc ), sets the headers, performs a powerbuilder sendRequest( ), loads the response, checks the response status code, and does error handling.

I am having a problem calling one of our SOAP web services located on a server on our network. I need to make 8-10 calls to this service in rapid succession, and the sendRequest( ) call will fail with -6 (unsupported charset) randomly throughout the 8-10 calls (but usually on the 2nd or 3rd call at least). The rest succeed.

The service is expecting the following headers:

Content-Type: text/xml; charset=utf-8

I can confirm that this is the same as what is being loaded using SetRequestHeaders( ), and SetRequestHeaders( ) is not failing.

I have tried the following so far (nothing has made a difference):

  1. Destroying a re-creating the HttpClient before each call to the service.
  2. Sleeping for 60 seconds between calls.
  3. Using both HTTP and HTTPS

I have used a TCP packet sniffer to trace the calls, and when the service call works I can see the packets. Whenever the sendRequest( ) returns -6 I do not see any packets appearing in my trace tool.

My gut tells me that this is not a Powerbuilder problem, and probably something to do with my service or the comm links between the client and the server, but I figured I'd ask here anyways. What's throwing me off is the sendRequest returning -6.

Thanks PB gurus.

Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 16 November 2021 02:23 AM UTC
  2. PowerBuilder
  3. # 1

Hi Colin,

 

Thanks for reporting this problem.

From the situation you described, when you execute the sendRequest() call, usually on the 2nd or 3rd call, it returns error -6 randomly.

We recommended that you check whether your server has responded to the requests and why it refused to respond to the requests.

In addition, since we have not obtained any information about the body that responded to the request, we cannot be 100% sure that the sendRequest returning -6 is correct or incorrect.

We will also recommend that our development department check if there is any issue in the relevant code.

 

BTW, other suggestions are as follows

  1. Please try to modify your SendRequest syntax as follows to see if it will still return -6 randomly.

           objectname.SendRequest (methodName, urlName, blob data)

           objectname.SendRequest (methodName, urlName, string data, EncodingUTF8!)

 

  1. Please use other tools, such as Fiddler, to see if you can grab any data when SendRequest returning -6 and send it to us for analysis

 

Regards,

Comment
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Thursday, 18 November 2021 14:23 PM UTC
  2. PowerBuilder
  3. # 2

Hi Colin

If I have understood correctly, when the sendRequest fails you cannot see any outbound packets from your PB client? If that's the case it cannot be a server side issue and must be something at the client side.

Is it possible that this could be data related? Are you able to reproduce this in the debugger? If so you could verify all the settings and data before the sendRequest.

Sorry not a lot of help, but I cannot think of anything else.

Regards

David

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.