Skip to main content

Web service calling native Cobol

  • October 16, 2015
  • 8 replies
  • 0 views

In Visual Studio 2012 I have created a C# WCF service (based on the WCF service library project template).

This weservice calls a managed Cobol class, which in turn calls native Cobol modules.

When I test the webservice the first call is handled correctly. But when I invoke the webservice again I get strange results.

After some analysis I learned that the cause of the problem is that when the native Cobol modules are called in the second webservice request the state of their Working-Storage is still as it was left after the first invocation of the webservice. In other words, the native modules are still in memory and their state has bee preserved.

Does anybody know how I can solve this?

 


#EnterpriseDeveloper

8 replies

Yvon Abgrall
  • Rocketeer
  • 37 replies
  • October 16, 2015

In Visual Studio 2012 I have created a C# WCF service (based on the WCF service library project template).

This weservice calls a managed Cobol class, which in turn calls native Cobol modules.

When I test the webservice the first call is handled correctly. But when I invoke the webservice again I get strange results.

After some analysis I learned that the cause of the problem is that when the native Cobol modules are called in the second webservice request the state of their Working-Storage is still as it was left after the first invocation of the webservice. In other words, the native modules are still in memory and their state has bee preserved.

Does anybody know how I can solve this?

 


#EnterpriseDeveloper

program-id. XXXXXXXX is initial.


Yvon Abgrall
  • Rocketeer
  • 37 replies
  • October 16, 2015

In Visual Studio 2012 I have created a C# WCF service (based on the WCF service library project template).

This weservice calls a managed Cobol class, which in turn calls native Cobol modules.

When I test the webservice the first call is handled correctly. But when I invoke the webservice again I get strange results.

After some analysis I learned that the cause of the problem is that when the native Cobol modules are called in the second webservice request the state of their Working-Storage is still as it was left after the first invocation of the webservice. In other words, the native modules are still in memory and their state has bee preserved.

Does anybody know how I can solve this?

 


#EnterpriseDeveloper

Hi,

documentation.microfocus.com/.../index.jsp;resultof="Program-ID" "Paragraph" "paragraph"

The Program-ID Paragraph

...

The INITIAL clause specifies that the program is initial. When an initial program is called, it and any programs contained within it are placed in their initial state. See the topic Initial State in the chapter Language Fundamentals.

...

Regards

Yvon


  • Author
  • Rocketeer
  • 19312 replies
  • October 16, 2015

In Visual Studio 2012 I have created a C# WCF service (based on the WCF service library project template).

This weservice calls a managed Cobol class, which in turn calls native Cobol modules.

When I test the webservice the first call is handled correctly. But when I invoke the webservice again I get strange results.

After some analysis I learned that the cause of the problem is that when the native Cobol modules are called in the second webservice request the state of their Working-Storage is still as it was left after the first invocation of the webservice. In other words, the native modules are still in memory and their state has bee preserved.

Does anybody know how I can solve this?

 


#EnterpriseDeveloper

Many thanks Yvon.


  • Author
  • Rocketeer
  • 19312 replies
  • October 16, 2015

In Visual Studio 2012 I have created a C# WCF service (based on the WCF service library project template).

This weservice calls a managed Cobol class, which in turn calls native Cobol modules.

When I test the webservice the first call is handled correctly. But when I invoke the webservice again I get strange results.

After some analysis I learned that the cause of the problem is that when the native Cobol modules are called in the second webservice request the state of their Working-Storage is still as it was left after the first invocation of the webservice. In other words, the native modules are still in memory and their state has bee preserved.

Does anybody know how I can solve this?

 


#EnterpriseDeveloper

I think I still have a problem. It works for the main module now. But this main module calls certain submodules miultiple time within one web service request. So I can't add the INITIAL clause to those submodules.


  • Author
  • Rocketeer
  • 19312 replies
  • October 16, 2015

In Visual Studio 2012 I have created a C# WCF service (based on the WCF service library project template).

This weservice calls a managed Cobol class, which in turn calls native Cobol modules.

When I test the webservice the first call is handled correctly. But when I invoke the webservice again I get strange results.

After some analysis I learned that the cause of the problem is that when the native Cobol modules are called in the second webservice request the state of their Working-Storage is still as it was left after the first invocation of the webservice. In other words, the native modules are still in memory and their state has bee preserved.

Does anybody know how I can solve this?

 


#EnterpriseDeveloper

I think I still have a problem. It works for the main module now. But this main module calls certain submodules miultiple time within one web service request. So I can't add the INITIAL clause to those submodules.


Yvon Abgrall
  • Rocketeer
  • 37 replies
  • October 16, 2015

In Visual Studio 2012 I have created a C# WCF service (based on the WCF service library project template).

This weservice calls a managed Cobol class, which in turn calls native Cobol modules.

When I test the webservice the first call is handled correctly. But when I invoke the webservice again I get strange results.

After some analysis I learned that the cause of the problem is that when the native Cobol modules are called in the second webservice request the state of their Working-Storage is still as it was left after the first invocation of the webservice. In other words, the native modules are still in memory and their state has bee preserved.

Does anybody know how I can solve this?

 


#EnterpriseDeveloper

The CBL_SUBSYSTEM . API could/would solve the issue to CANCEL the tree of called programs....

In the main module.

Use  program-id. XXXXXXXX is initial.

Use CBL_SUBSYSTEM->0: Declare subsystem

call the 'directory tree

Finally  CBL_SUBSYSTEM->Cancel subsystem  

... The" CBL_SUBSYSTEM->Cancel subsystem" will COBOL CANCEL the whole called directory tree... in one shot

documentation.microfocus.com/.../index.jsp;cp=5_7_3_9_1_0

CBL_SUBSYSTEM ... Declares or deallocates subsystems.

:) Yvon


  • Author
  • Rocketeer
  • 19312 replies
  • October 16, 2015

In Visual Studio 2012 I have created a C# WCF service (based on the WCF service library project template).

This weservice calls a managed Cobol class, which in turn calls native Cobol modules.

When I test the webservice the first call is handled correctly. But when I invoke the webservice again I get strange results.

After some analysis I learned that the cause of the problem is that when the native Cobol modules are called in the second webservice request the state of their Working-Storage is still as it was left after the first invocation of the webservice. In other words, the native modules are still in memory and their state has bee preserved.

Does anybody know how I can solve this?

 


#EnterpriseDeveloper

Thanks again Yvon. I think this solves my issue completely.


  • Author
  • Rocketeer
  • 19312 replies
  • October 17, 2015

In Visual Studio 2012 I have created a C# WCF service (based on the WCF service library project template).

This weservice calls a managed Cobol class, which in turn calls native Cobol modules.

When I test the webservice the first call is handled correctly. But when I invoke the webservice again I get strange results.

After some analysis I learned that the cause of the problem is that when the native Cobol modules are called in the second webservice request the state of their Working-Storage is still as it was left after the first invocation of the webservice. In other words, the native modules are still in memory and their state has bee preserved.

Does anybody know how I can solve this?

 


#EnterpriseDeveloper

Use the compiler directive Data-Context.