Web Service Call Variable Question

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,


  • Verified Answer

    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.