Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: Consuming WCF in NAtive Code via Managed Code in Visual COBOL

$
0
0

I believe the problem is that you are trying to pass in certain non-managed data types to the web service when they should be managed.

I would recommend packaging these separate parameters into a COBOL group item and then passing the entire record as a string or a byte array. You can then set these back to the group item for processing.

Examples:

01 myparams.
     03 1stparm  pic 9(2).
     03 2ndparm  pic 9(8) Comp-5.
     03 3rdparm  pic x(150).
     03 4thparm  pic 9.  
01 mystring string.  
01 myret binary-long.

          move 50 to 1stparm
          move 987 to 2ndparm
          move "from com" to 3rdparm
          move 5 to 4thparm
          set mystring to myparams
          set myret to wcfservice::TestCall(mystring)
          set myparams to mystring

In the service:

      method-id TestCall public.
      01 myparams.
           03 1stparm  pic 9(2).
           03 2ndparm  pic 9(8) Comp-5.
           03 3rdparm  pic x(150).
           03 4thparm  pic 9.      
      procedure division using mystring as string
         returning myret as binary-long.

          set myparams to mystring
          move 99 to myret
          move "test" to 3rdparm
          set mystring to myparams

          goback.

      end method.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>