Cadet 1st Class
Cadet 1st Class
751 views

Web Service Call Variable Question

Jump to solution

This is really more of a cobol question.  I'm calling a web service from a native cobol program that contains code that was generated by the MicroFocus tool "Generate Client from WSDL" in Visual Cobol.  In general, this is working fine.  In the generated code, there are two variables, wsc-srvc-address, which appears to be the URL of the service, and wsc-srvc-address-len, which is the length in bytes of the URL.  Right now both of the values are hard-coded.  So....

1.  wsc-srvc-address is defined as "pic n(256) usage national."  What is "pic n," and what does "usage national" mean.

2.  How does it differ from your basic "Pic X" string?

3.  The "value" clause has an "n" in front of the value (i.e. n"http://your.basic.url").  What does the "n" do?

Because my service runs on different servers, I need to have a different version of the client program on each server with the URL hard coded differently on each.  Again, this works okay, but I'd like to have one version of the program and pass in the URL from either a file or a parameter.  But when I try to move a value to wsc-srvc-address in the program, my call fails with an http 500 error (not found).  Note, the URL is the same length in this case, so the wsc-srvc-address-len doesn't need to change.  How can I assign a string to wsc-srvc-address?

Please note, at this point it is not feasible to convert the entire system or even this program into managed cobol.

Thanks for the help,

Mike

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert
The PIC N fields and N"literals" are usage national which is used to store Unicode characters (UTF-16). You can define these in your own programs but make sure that you turn on the NSYMBOL"NATIONAL" directive. The differ from PIC X in that they store 2 bytes making up the one UTF-16 character per specified "N" and PIC X stores single byte ANSI characters.

You could just have one actual client program that calls one of the generated proxy programs depending on which server you needed to call. You can rename the proxy programs to be whatever you wish.

View solution in original post

0 Likes
1 Reply
Micro Focus Expert
Micro Focus Expert
The PIC N fields and N"literals" are usage national which is used to store Unicode characters (UTF-16). You can define these in your own programs but make sure that you turn on the NSYMBOL"NATIONAL" directive. The differ from PIC X in that they store 2 bytes making up the one UTF-16 character per specified "N" and PIC X stores single byte ANSI characters.

You could just have one actual client program that calls one of the generated proxy programs depending on which server you needed to call. You can rename the proxy programs to be whatever you wish.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.