View previous topic :: View next topic
|
Author |
Message |
f_caballero
New User
Joined: 11 Mar 2010 Posts: 5 Location: Spain
|
|
|
|
Hi!
I have installed a requester web service in CICS.
My COBOL application runs INVOKE WEBSERVICE to send the SOAP request to web service provider.
The provider has problems to understand some characters in the message because the message does not include the first record with the text: '<?xml version="1.0" encoding="UTF-8"?>'.
The question is:
Is it possible to insert this line in the header of the generated SOAP message?
I have reviewed manuals and documentation but I do not found some article that gives me a way to do it.
Thanks a lot in advance. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Are you using XML GENERATE? If so, WITH ENCODING 1208 will generate UTF-8 characters (it took less than 3 minutes in the COBOL manuals linked at the top of the page to find this out). If not, you're going to need to read section 1.7.6 of the COBOL Programming Guide (manuals link at the top of the page), and you will probably run into a number of other issues along the way.
Just inserting the text string is worthless if the data you're passing is not UTF-8 format, which has a variable number of bytes per character. So not only do you need to insert the string but you must ensure the message uses the appropriate codepage. |
|
Back to top |
|
|
f_caballero
New User
Joined: 11 Mar 2010 Posts: 5 Location: Spain
|
|
|
|
Thanks for your response Robert.
The COBOL program does not generate the XML message.
CICS facilities of Webservices generate the XML:
- DFHWS2LS batch job to generate COBOL COPYS and WSBIND file from the Web Services Description Language (WSDL) file that describes the SOAP messages.
- Requester PIPELINE to manage the format conversions and communication with the Web service provider.
- And EXEC CICS INVOKE WEBSERVICES ..... to communicate mainframe application in COBOL and Web services.
So, the generation of XML code is out of scope for the COBOL program.
Regards. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
So either you don't need to do anything in the COBOL program, or you need to find out how to change DFHWS2LS or the WSDL to use UTF-8. As I said, just putting the encoding in a heading doesn't do anything for you. The heading should be automatically generated by the WSDL or DFHWS2LS -- if not, you need to find out why not. |
|
Back to top |
|
|
f_caballero
New User
Joined: 11 Mar 2010 Posts: 5 Location: Spain
|
|
|
|
I think as you, and I have reviewed about the WS2LS parameters.
From the beginning I have suspected that he was something that had relation with the treatment of the WSDL file.
My knowledge about this is very limited and I can not found the "magic word" that makes appear, or disappear, the head line.
I have investigated about the headers handlers and I think that I can include a COBOL program, executed from the configuration of the CICS PIPELINE to insert the first line in the container that takes the message.
Thanks again.
Regards. |
|
Back to top |
|
|
f_caballero
New User
Joined: 11 Mar 2010 Posts: 5 Location: Spain
|
|
|
|
Hi again, the case has been closed and solved.
This the "magic word":
Use "CCSID=1145" during wsbind file generation by runing DFHWS2LS.
That does no insert the heading line "<?xml version="1.0" encoding="UTF-8"?>"; it is not really necessary.
The problem was we are using the CICS default code-page "037" that does not include the Spanish local character "Ñ".
I think I have to improved my ability to read in English (and to write too, of course).
Thanks and bye. |
|
Back to top |
|
|
|