# EntireX as web service? How? Samples?

**URL:** <https://techcommunity.softwareag.com/t/entirex-as-web-service-how-samples/58884>\
**Category:** Forum\
**Tags:** Mainframe-Integration, EntireX\
**Created:** [July 2, 2003, 2:53am UTC](https://techcommunity.softwareag.com/t/entirex-as-web-service-how-samples/58884 "2003-07-02T02:53:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Shohet](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@Jason\_Shohet](https://techcommunity.softwareag.com/u/Jason_Shohet)\
**Post date:** [July 2, 2003, 2:53am UTC](https://techcommunity.softwareag.com/t/entirex-as-web-service-how-samples/58884/1 "2003-07-02T02:53:14Z")

</div>

I am new to EntireX. I’m going thru reams of documentation, java / web / xml examples etc, but none of them deal with building a web-service & calling the broker to get info from the mainframe.  
We’re able to do it via an Access application. We want to do it with a web service instead… Can anyone point me to a link or some code somewhere 🙂 ?  
  
Thanks  
Jason Shohet 212-863-6481

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [July 2, 2003, 3:31am UTC](https://techcommunity.softwareag.com/t/entirex-as-web-service-how-samples/58884/2 "2003-07-02T03:31:51Z")

</div>

Hi Jason,  
  
refer to your earlier posting. I sent you a response with more details. Have a look at [Response to 1’st Posting](http://forums.tamino.com/3/OpenTopic?a=tpc&s=153292895&f=7672974124&m=2382907127#2382907127)  
  
EntireX also provides some code examples with the default installation. Please refer to the following directory: C:\Program Files\Software AG\EntireX\Examples\XML Wrapper  
  
There is simple example called “calc”. The original IDL file, as well as natural subprograms are provided under the followin directory: C:\Program Files\Software AG\EntireX\Examples\DCOM Wrapper\calc  
  
Ask one of your mainframe colleagues to upload these Natural subprograms and create a sample RPC service for you. If that is not possible use the calc IDL file and create a Java RPC server program. You can start the RPC Server on your machine locally and then test your web service as if it was the mainframe.  
  
I’m including a sample command file and attaching a properties file that will show you how to start the JAVA RPC Service. To do this you will have to start a Broker instance on your development machine. Let me know if you need help in starting creating and configuring a Broker instance.  
  
Command File:  
java -Dentirex.server.properties=rpcserver.properties com.softwareag.entirex.aci.RPCServer  
  
Let me know if you need additional information.  
  
Regards  
Theo

---

<div class="post-metadata">

**Author:** ![Jason\_Shohet](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@Jason\_Shohet](https://techcommunity.softwareag.com/u/Jason_Shohet)\
**Post date:** [July 3, 2003, 2:24am UTC](https://techcommunity.softwareag.com/t/entirex-as-web-service-how-samples/58884/3 "2003-07-03T02:24:18Z")

</div>

DOCUMENTATION LACKING?  
Thanks for your replies. Yes, all your assumptions are true. The problem is, I know how to create a web service in .NET using C#. But EntireX’s documentation does not describe how to do it in .NET. Lots of techno-jargon, words like interface, RPC, mapping, adapter, runtime yada yada, without any real steps to take. I need information on what the .cs file or .vb file looks like in .NET, to access the Broker. What steps I need to take to get it to work etc 🙂  
  
WHAT IS JAVA OR DCOM FOR?  
The code samples given are for java or dcom. Java is out, we use IIS here. And what is the DCOM for? Isn’t that an antiquated architecture, I don’t even know how to use .NET with DCOM. I would have expected to see a .NET page describing the vb, c++ or c# code needed to create the web service.  
  
WE NEED A PROXY TO THE WS, NOT AN HTTP REQUEST  
Our client would be a web client. So it looks like, from the diagram in the documentation, that there’s a web client that does an HTTP request. But thats not desirable for us. We want a proxy dll for the web service that we can use serverside, and call from within our applications. ie, we don’t want to access the mainframe thru http requests passing parameters in the URL.  
  
Thanks  
Jason Shohet 212-863-6481

---

<div class="post-metadata">

**Author:** ![Jason\_Shohet](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@Jason\_Shohet](https://techcommunity.softwareag.com/u/Jason_Shohet)\
**Post date:** [July 3, 2003, 5:32am UTC](https://techcommunity.softwareag.com/t/entirex-as-web-service-how-samples/58884/4 "2003-07-03T05:32:03Z")

</div>

Well going thru more of the documentation, its more than techno-jargon, I see the applications for instantiating a broker object.   
  
I guess I am confused because it seems you support Java clients. Or http clients. But what about a .NET client, as a web service. In other words, the web service is created in .NET and a proxy (dll) is created, that can be called from within web applications.   
  
Thats what I’m not seeing, I don’t know the path to get there.  
  
Thanks and sorry for troubling everyone!

---

<div class="post-metadata">

**Author:** ![Rolf\_Bahlke](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/rolf_bahlke/32/109_2.png) [@Rolf\_Bahlke](https://techcommunity.softwareag.com/u/Rolf_Bahlke)\
**Post date:** [July 3, 2003, 1:38pm UTC](https://techcommunity.softwareag.com/t/entirex-as-web-service-how-samples/58884/5 "2003-07-03T13:38:18Z")

</div>

Hi Jason,  
  
EntireX version 6.1/6.2 does not support .NET directly.  
  
You need EntireX version 7.1.1 which has been released a few weeks ago.  
It includes a .NET Wrapper which generates a C# .NET component.  
  
In the docu see “EntireX Developer’s Kit” → “Using EntireX with .NET”.  
  
Kind regards,  
Rolf

---

<div class="post-metadata">

**Author:** ![Dietmar\_Gartner](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/dietmar_gartner/32/127_2.png) [@Dietmar\_Gartner](https://techcommunity.softwareag.com/u/Dietmar_Gartner)\
**Post date:** [July 3, 2003, 7:26pm UTC](https://techcommunity.softwareag.com/t/entirex-as-web-service-how-samples/58884/6 "2003-07-03T19:26:30Z")

</div>

Hi Jason,  
  
the EntireX 7.1.1 .NET Wrapper generates C# classes that implement a client stub for an EntireX RPC service described by an (EntireX) IDL description.  
See the “EntireX Developer’s Kit” → “EntireX .NET Wrapper” → “Writing Applications - EntireX .NET Wrapper” for a detailed description how to write an EntireX .NET application.  
  
The generated C# client stub is not .NET Web service enabled by itself. But you can easily create a .NET Web service with Visual Studio .NET that publishes methods of the EntireX RPC service (or own methods that just use the EntireX RPC service) with VS .NET.  
  
Example:  
I assume the .NET Wrapper Example EntireX\Examples\NET Wrapper\client\calc has been built as described in the README file. Then a new “ASP .NET Web Service” project can be created with references to the generated client stub and the .NET Wrapper runtime. The following code can be used as an example (in the .asmx file) how to implement a Web method “Hi” that exposes the “Hello” method of the example.  
  
Regards, Dietmar.  
  
—  
  
using System;  
using System.Collections;  
using System.ComponentModel;  
using System.Data;  
using System.Diagnostics;  
using System.Web;  
using System.Web.Services;  
using System.Text;  
using SoftwareAG.EntireX.NETWrapper.Runtime;  
using SoftwareAG.EntireX.NETWrapper.Generated.example;  
  
namespace WebService1  
{  
 ///

#  
 /// Summary description for Service1.  
 ///   
 public class Service1 : System.Web.Services.WebService  
 {  
 public Service1()  
 {  
 //CODEGEN: This call is required by the [ASP.NET](http://ASP.NET) Web Services Designer  
 InitializeComponent();  
 }  
  
#region Component Designer generated code  
  
 //Required by the Web Services Designer   
 private IContainer components = null;  
  
 /// #  
 /// Required method for Designer support - do not modify  
 /// the contents of this method with the code editor.  
 ///   
 private void InitializeComponent()  
 {  
 }  
  
 /// #  
 /// Clean up any resources being used.  
 ///   
 protected override void Dispose( bool disposing )  
 {  
 if(disposing && components != null)  
 {  
 components.Dispose();  
 }  
 base.Dispose(disposing);   
 }  
  
#endregion  
  
 // WEB SERVICE EXAMPLE  
  
 [WebMethod]  
 public string Hi(string message)  
 {  
 Example e = new Example();  
 StringBuilder msg = new StringBuilder(“Hello and goodbye!”);  
 e.Hello(“”, ref msg);  
 return msg.ToString();  
 }  
 }  
}

---

<div class="post-metadata">

**Author:** ![Jason\_Shohet](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@Jason\_Shohet](https://techcommunity.softwareag.com/u/Jason_Shohet)\
**Post date:** [July 4, 2003, 3:03am UTC](https://techcommunity.softwareag.com/t/entirex-as-web-service-how-samples/58884/7 "2003-07-04T03:03:02Z")

</div>

Wow this is great!!! Thank you for steering me in the right direction.   
  
Now my mainframe guy is asking me how to create an IDL file that describes the natural functions he has… I told him i have no idea, read the documentation 🙂 Well the story continues on Monday.  
Have a happy 4th!  
  
Jason Shohet

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [July 7, 2003, 10:14pm UTC](https://techcommunity.softwareag.com/t/entirex-as-web-service-how-samples/58884/8 "2003-07-07T22:14:03Z")

</div>

Hi Jason,  
  
the mainframe programmer should have a Natural subprogram you can access. The Natural subprogram begins with a ?Define Data? statement, in the example below I have extracted the Data Area of the subprogram called ?LISTPAT?, this subprogram is stored within a Natural Library called ?PATLIB?:  
  
DEFINE DATA  
 PARAMETER  
 1 #PROGRAM\_VARIABLES  
 2 #START\_PATIENT\_NO (N8)  
 2 #PATIENT\_LIST (1:100)  
 3 #PATIENT\_NO (N8)  
 3 #PATIENT\_FIRST\_NAME (A25)  
 3 #PATIENT\_LAST\_NAME (A25)  
 2 #MESSAGE (A80)  
  
 END-DEFINE  
  
In the workbench you create an IDL file, which should look something like the following:  
  
library ‘PATLIB’ is  
 program ‘LISTPAT’ is  
 define data parameter  
 1 start\_patient\_no (N8) In  
 1 patientList (/100) Out  
 2 patient\_no (N8)   
 2 patient\_first\_name (A25)   
 2 patient\_last\_name (A25)   
 1 message (A80) Out  
 end-define  
  
The ?library? name in the IDL file should correspond to the Natural library name in which the Natural subprogram resides. The ?program? name should correspond the Natural subprogram name. You will note that in the example I have specified additional parameters ?In? or ?Out? to the variables in the IDL file. These parameters indicate whether the contents of the variables are only to be sent to the mainframe subprogram (In) or to be returned by the mainframe subprogram (Out). You can also specify ?In/Out?, which would mean that the contents of the variable would be sent and received. For a more detailed explanation on the syntax used in the IDL file and also which data types are supported please refer to:  
C:\Program Files\Software AG\EntireX\Docu\devkit\idl\idl.htm  
(EntireX Developer’s Kit → Interface Definition Language for EntireX RPC)  
  
  
To create the IDL file you could easily copy and paste the contents of the Parameter Data Area from the subprogram into the IDL file.   
  
There is also another way of doing this. You could generate the IDL file from directly from the Natural subprogram source code. This can be done using the Natural IDL Generator, which is provided as part of the EntireX installation on your desktop.   
  
For more information on how to use the Natural IDL Generator please refer to the following chapter in the EntireX documentation: C:\Program Files\Software AG\EntireX\Docu\devkit\natural\natidl.htm (EntireX Developer’s Kit → EntireX Natural IDL Generator)  
  
For more information on how to setup the mainframe environment, please refer your mainframe guy to the following sections in the documentation:  
  
C:\Program Files\Software AG\EntireX\Docu\admin\os390\natidl.htm  
(EntireX Developer’s Kit → EntireX Natural IDL Generator → Troubleshooting → Server Configuration OS/390)  
  
For setting up the RPC environment on the mainframe, please refer him to the following section in the Natural documentation: (Natural Remote Procedure Call → Setting Up a Natural RPC Environment → Setting up a Natural RPC Environment)  
  
(Natural Remote Procedure Call → Setting Up a Natural RPC Environment → Operating a Natural RPC Environment)  
  
  
Hope this helps.  
  
Regards  
Theo

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:39pm UTC](https://techcommunity.softwareag.com/t/entirex-as-web-service-how-samples/58884/9 "2021-04-02T14:39:32Z")

</div>


