Consuming a webservice returns error 500 because of the lack of a Header property |
The solution to the error 500 is not always the one that will be discussed below, though it is a good starting point to check and resolve if that is the case.
When you are going to develop a webservice client program that will consume webservices, it is a good practice to test the webservices consumption on a third-party software like SoapUI.
In this article we use SoapUI as an example. Other options are available though. For instance if you have a REST webservice you could use Postman instead.
When you test the webservice in SoapUI you have an option to check the input XML in Raw format as follows:

In this screenshot, you can see an entry for SOAPAction.
In order to resolve the error 500 you may need to send this Header property before invoking the doPostEx method, in addition to the normal steps to develop a client webservice (using the stream2wrk to generate the working-storage section structure for the input XML, output XML, etc.). This Header property is written as follows.
http:>setHeaderProperty("soapaction", '"http://www.someurl.com/services/SysLogin"')
Notice that the value of the header includes double quotes [ " ] at the start and end of the string, therefore, the whole value is enclosed in single quotes [ ' ].
With this additional code, the client program will forward the same header property that SoapUI sends before trying to consume the webservice, fixing the error 500. You will get a successful return code 200.
|
Authored
by: Veryant Support
This question has been viewed 1355 times so far.
|
Click
Here to View all the questions in isCOBOL EIS
category. |
File Attachments |
There are no attachment file(s) related to this question. |
|
User Comments |
 |
|
There are no user comments for this question. Be the first to post a comment. Click Here |
Related Questions
|
- How do you handle printing from the WebClient?
- Working with isCOBOL, is there a native support for REST and SOAP Web Services?
- How can I control or restrict access to my WebClient applications and see the user name displayed in the WebClient console?
- Guide to update the isCOBOL runtime libraries on isCOBOL Web Applications running on Tomcat
|