# Natural Subpgm(as a web service) Calling another Web Service

**URL:** <https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210>\
**Category:** Forum\
**Tags:** Mainframe-Integration, EntireX\
**Created:** [March 31, 2010, 7:40pm UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210 "2010-03-31T19:40:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris3](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@chris3](https://techcommunity.softwareag.com/u/chris3)\
**Post date:** [March 31, 2010, 7:40pm UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/1 "2010-03-31T19:40:47Z")

</div>

Hi,

Scenario:  
I have a sub program (ELVRWS03) that calls a web service (ELRPC001).

Case 1 (Works Fine):  
A Natural Program calls subprogram ELVRWS03. EVLRWS03 then calls web service ELRPC001 and everything works fine.

Case 2 (NAT0082 is encountered):  
I “exposed” ELVRWS03 as a web service. A consumer (.NET Application) calls ELVRWS03 and works fine until ELVRWS03 calls web service ELRPC001. The exact error message I have is:

Broker Error 1001 0016: Callee not found. Library: VRWEBSERVICE, Program: ELVRWS03 ELVRWS03 4910 NAT0082 Invalid command, or Subprogram ELRPC001 does not exist in library., NE=01,ELVRWS03491002O

Is there a way to make this approach work?

Thank you very much.

Regards,

Chris

---

<div class="post-metadata">

**Author:** ![anon66457657](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@anon66457657](https://techcommunity.softwareag.com/u/anon66457657)\
**Post date:** [April 1, 2010, 11:11pm UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/2 "2010-04-01T23:11:49Z")

</div>

Chris,  
it appears that you did you set AUTORPC=ON for the Natural RPC server that exposes ELVRWS03 as a web service´.

---

<div class="post-metadata">

**Author:** ![chris3](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@chris3](https://techcommunity.softwareag.com/u/chris3)\
**Post date:** [April 2, 2010, 12:08am UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/3 "2010-04-02T00:08:51Z")

</div>

Hi Wolfgang,

After checking I found that AUTORPC=ON was NOT included.

a) Original Settings: RPC=(SERVER=ON,RPCSIZE=1040,MAXBUFF=1024,…

Result: Broker Error 1001 0016: Callee not found. Library: VRWEBSERVICE, Program: ELVRWS03 ELVRWS03 4910 NAT0082 Invalid command, or Subprogram ELRPC001 does not exist in library., NE=01,ELVRWS03491002O

b) Added AUTORPC=ON  
Result: Broker Error 1014 6974: Natural RPC Server returns: ELVRWS03 4910 NAT6974 Conversion error on Client, reason 7 ,000., NE=01,ELVRWS03491002O

Natural Help Details  
NAT6974, Reason 7 = No space for working storage in RPC size. Increase RPC size on :1: side.

c) Increased RPCSIZE=9999  
Result: Broker Error 1014 6971: Natural RPC Server returns: ELVRWS03 4910 NAT6971 Connection error on Client, reason 7 ,RPCXMLOUT /BKR144., NE=01,ELVRWS03491002O

Natural Help Details  
NAT6971, Reason 7 = Node not active.  
After the reason, the message displays the server/node in question.  
With AUTORPC=ON this error may also occur instead of a local NAT0082  
error on the client side.

Just to make sure that the server was working fine and isolate “Node not active” error, I tested calling another natural subprogram that I ‘exposed’ as a web service(ELVRWS02). ELVRWS02 is very basic/simple and does not call another web service like ELVRWS03. ELVRWS02 completed successfully.

Unfortunately adding AUTORPC=ON did not resolve the issue.

Hope the above information helps.

Thanks,

Chris

---

<div class="post-metadata">

**Author:** ![anon66457657](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@anon66457657](https://techcommunity.softwareag.com/u/anon66457657)\
**Post date:** [April 2, 2010, 1:31am UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/4 "2010-04-02T01:31:04Z")

</div>

Chris,  
our Natural RPC server tries to access BKR144 via Adabas communication.  
Does your Natural RPC server and BKR144 run on the same mainframe?  
Regards, Wolfgang

---

<div class="post-metadata">

**Author:** ![chris3](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@chris3](https://techcommunity.softwareag.com/u/chris3)\
**Post date:** [April 2, 2010, 2:27am UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/5 "2010-04-02T02:27:26Z")

</div>

Hi Wolfgang,

I’m still gathering the required information to reply to your query and will post it here as soon as possible.

In the meantime I would like to clarify the components involved in my scenario:

a) ELVRWS03 - is a Natural Subprogram exposed as a Web Service.  
b) ELRPC001 - refers to a third party Web Service written in JAVA. It is consumed via a CALLNAT statement in ELVRWS03.

Process Flow:  
Step 1) A .NET Application consumes web service ELVRSWS03.

Step 2) ELVRSWS03 will process the data supplied by the .NET Application. As part of the ELVRWS03 process, it will consume ELRPC001 (this is the part that fails).

In summary:  
.NET Application (Windows Forms) -----\> ELVRSWS03/Natural Subprogram (as Web Service) -----\> ELRPC001/Java Application (Web Service)

Can I assume that your current RPC Server and Mainframe setup allow you to achieve this process/approach successfully?

Thanks,

Chris

---

<div class="post-metadata">

**Author:** ![anon66457657](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@anon66457657](https://techcommunity.softwareag.com/u/anon66457657)\
**Post date:** [April 6, 2010, 2:37pm UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/6 "2010-04-06T14:37:19Z")

</div>

Hi Chris,  
a Natural RPC server can consume a web service. In this case the Natural RPC server has also to be setup as a Natural RPC client.  
Best regards,  
Wolfgang

---

<div class="post-metadata">

**Author:** ![chris3](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@chris3](https://techcommunity.softwareag.com/u/chris3)\
**Post date:** [April 8, 2010, 1:40am UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/7 "2010-04-08T01:40:58Z")

</div>

Hi Wolfgang,

You asked: Does your Natural RPC server and BKR144 run on the same mainframe?

Answer: Yes, BKR144 and the Natural RPC service RPCXMLOUT are both residing on the same mainframe

When you said “the Natural RPC server has also to be setup as a Natural RPC client”, do the changes need to be made in SYSRPC on the mainframe or on the XML Runtime server?

Thanks,

Chris

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [April 8, 2010, 7:58pm UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/8 "2010-04-08T19:58:04Z")

</div>

Problem is on the Natural RPC side, not the XML run time. You need to make sure that the Natural that is running the RPC server has the SYSRPC (NATCLTGS) module available and either is running with AUTORPC=ON or has a stub generated.

Whatever configuration you needed to make the CALLNAT to the web service work when called from the Natural program needs to also be available to the Natural RPC Server.

---

<div class="post-metadata">

**Author:** ![Deb](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@Deb](https://techcommunity.softwareag.com/u/Deb)\
**Post date:** [April 8, 2010, 9:31pm UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/9 "2010-04-08T21:31:12Z")

</div>

Hi all. I’m Chris’s system admin on the mainframe side of the equation.  
Since I’m not sure Chris is being completely clear about what he is attempting to do I’ll share my understanding.

Chris has an application that currently resides and is accessed via the mainframe. The mainframe application makes a CALLNAT to a Natural subprogram (ELVRWS03) that in turn does a CALLNAT to a web service (ELRPC001). This works successfully for him.

He is now trying to allow another user to access the application. This user is not coming from a mainframe application but rather a PC client application. Therefore, Chris “exposed” the Natural subprogram ELVRWS03 to the PC Client as a web service using the Workbench.  
The PC Client can execute the “exposed” web service ELVRWS03 correctly but then has problems when ELVRWS03 attempts to CALLNAT another web service (ELRPC001).

My first question (and probably not my last on this topic) - can a web service on the mainframe call another web service?

Douglas, Chris is using an already existing RPC service - this is not a new RPC service. So when you say “Whatever configuration you needed to make the CALLNAT to the web service work when called from the Natural program needs to also be available to the Natural RPC Server.” how would this be accomplished? I’m under the impression that the configuration is already there and working for him.

I must admit - I’m relatively new to the whole web service/RPC thing and have only been doing systems admin work for SAG products for the last 2 years or so. I have a lot to learn and am still trying understand all the nuances of the products. Please bear with me if I end up asking a lot of questions that seem to be overly basic.

Deb

---

<div class="post-metadata">

**Author:** ![Aldo\_Teusch](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/aldo_teusch/32/87_2.png) [@Aldo\_Teusch](https://techcommunity.softwareag.com/u/Aldo_Teusch)\
**Post date:** [April 9, 2010, 12:31pm UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/10 "2010-04-09T12:31:25Z")

</div>

Hi all,  
I’m not sure to understand all the details given so far, but in a similar case, where node was not reachable when TCP/IP communication was involved, I had to append the portname when defining the broker name i.e. :18024.  
Just an idea …  
Aldo

---

<div class="post-metadata">

**Author:** ![anon66457657](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@anon66457657](https://techcommunity.softwareag.com/u/anon66457657)\
**Post date:** [April 9, 2010, 5:05pm UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/11 "2010-04-09T17:05:28Z")

</div>

Hi Chris,  
the comment of Aldo is correct. Depending on the used EntireX Broker stub the default communications method is either NET or TCP.  
If your Broker BKR144 is not found, there is a good chance that the EntireX Broker stub tries to use TCP/IP instead of NET.  
Please try one of the following names for your EntireX Broker:

- BKR144::NET  
(to enforce NET communication to DBID 144)
- :  
(to enforce TCP/IP communication to port on host )  
 is the name of the host on which the Broker is running. I would also recommend to append the domain name.  
Best regards,  
Wolfgang

---

<div class="post-metadata">

**Author:** ![anon66457657](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@anon66457657](https://techcommunity.softwareag.com/u/anon66457657)\
**Post date:** [April 9, 2010, 5:22pm UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/12 "2010-04-09T17:22:21Z")

</div>

Chris,  
regarding the modifications to your existing Natural RPC server to act as a Natural RPC client:

1. add the RPC profile parameters that are already used by your existing Natural RPC client  
(DFS, AUTORPC)
2. correct the EntireX Broker ID in DFS as already recommended
3. double the value for RPCSIZE  
Best regards  
Wolfgang

---

<div class="post-metadata">

**Author:** ![chris3](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@chris3](https://techcommunity.softwareag.com/u/chris3)\
**Post date:** [April 13, 2010, 7:51pm UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/13 "2010-04-13T19:51:24Z")

</div>

Hi Wolfgang, Aldo and Douglas,

Thanks for the suggestions. I tried the following changes:

a) Include subparameter AUTORPC=ON  
b) Double the RPCSIZE to 2080  
c) Set subparameter SRVNODE=‘BKR144:18026:TCP’

I’m still getting the error:

```auto
Broker Error 1014 6971: Natural RPC Server returns: ELVRWS03 4910 NAT6971 Connection error on Client, reason 7 ,RPCXMLOUT /BKR144., NE=01,ELVRWS03491002O
```

Your comments and suggestions really help me to try to make this work. However someone made a comment that this is NOT POSSIBLE. This CANNOT be achieved. As for the changes in subparameter values his comments were:

> [@](#):
>
> RPC size, as specified in the RPC started task, applies to the inbound rpc service, not the outbound rpcservice

> [@](#):
>
> DFS is just a default server name, but your call to the natural user exit overrides that anyway

I hope I’m not chasing a ghost. What do you think? Is this scenario really possible?

```auto
.NET Application (Windows Forms) ---(consumes)--> ELVRSWS03/Natural Subprogram (as Web Service) ---(consumes)--> ELRPC001/Java Application (Web Service) 
```

Is this one of those conceptually possible but will not work technically? Perhaps our environment does not support this unlike yours?

Thanks,

Chris

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [April 13, 2010, 9:56pm UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/14 "2010-04-13T21:56:18Z")

</div>

It absolutely can and does work. I have a customer that has been doing this for many years already.

The NAT6971 reason 7 indicates that it can’t reach that Broker node “BKR144”. The error message doesn’t show the port number, which suggests it is not picking up the override parameters you are trying to put in as part of the DFS settings.

Are you using SYSRPC/NATCLTGS, DFS parameters or the USR2007N API to set your target Broker and server? I’d suggest using USR2007N, at least to start, as it gives you the closest control over where the CALLNAT will go to.

RPCSIZE applies to both the client and the server.

Deb: I don’t know exactly how Chris is calling the web service from his Natural client compared to how the Natural RPC Server does it. Are all of the NATPARMs the same in each case? Is the Natural RPC Server logged on to the same library as Chris was using when he does the Natural client call? Or does the RPC Server subprogram set the library before attempting its call? If not, the NATCLTGS and steplibs may be different. Using USR2007N in both cases ensures that the same configuration is being used.

---

<div class="post-metadata">

**Author:** ![chris3](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@chris3](https://techcommunity.softwareag.com/u/chris3)\
**Post date:** [April 13, 2010, 10:35pm UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/15 "2010-04-13T22:35:58Z")

</div>

Hi Douglas,

Inside ELVRWS03 I use USR2007N just before calling Web Service ELRPC001.

```auto
 CALLNAT 'USR2007N' 'P' #BROKER-ID #SERVER #LOGON #PROTOC  
 CALLNAT 'ELRPC001' WSREQUEST(AD=O) WSRESULT(AD=A)
```

Where:  
ELVRWS03 = The Natural Subprogram I exposed as a web service so that a .Net Application can consume it.

ELRPC001 = refers to a Web service written in Java and is outside of the mainframe.

I’ll wait for Deb’s answers to your questions. Hopefully it may lead me/us to something.

Thanks a lot!

Regards,

Chris

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [April 14, 2010, 10:04pm UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/16 "2010-04-14T22:04:50Z")

</div>

so what are you passing in as #BROKER-ID to USR2007N? According to the error message, you are passing “BKR144”, but, according to the other comments, it needs to be a TCP/IP address and port number.

If you go to a TSO session READY prompt and enter “ping BKR144”, does it respond with an IP address and response time? - something like:

```auto

 CS V1R10: Pinging host DDDD.co.com (10.20.91.20)        
 Ping #1 response took 0.001 seconds.  
```

or does it respond with “unknown Host ‘BKR144’”? If the host name is unknown, try using “127.0.0.1:18026” as the Broker ID.

You don’t have to use TCP/IP to talk to the Broker from the Natural RPC Server. If the Broker’s DBID is 144, then “BKR144” (or “BKR144::NET”) should use SVC to communicate with it.

---

<div class="post-metadata">

**Author:** ![chris3](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@chris3](https://techcommunity.softwareag.com/u/chris3)\
**Post date:** [April 15, 2010, 2:30am UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/17 "2010-04-15T02:30:25Z")

</div>

Hi Douglas,

a) Data being passed to USR2007N:

```auto
#BROKER-ID: BKR144
#SERVER: RPCXMLOUT
#LOGON:           
#PROTOC: B  
```

b) The response I got from “ping BKR144” in TSO:

```auto
CS V1R10: Pinging host BKR144.xxxxx.xxxx.xxx (yyy.yy.yy.y)
Ping #1 response took 0.000 seconds.                    
```

I suppose the result in b) is a good sign?

Thanks,

Chris

---

<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:** [April 15, 2010, 2:40am UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/18 "2010-04-15T02:40:23Z")

</div>

> [@chris](#):
>
> Data being passed to USR2007N:
> 
> ```auto
> #BROKER-ID: BKR144
> #SERVER: RPCXMLOUT
> #LOGON:           
> #PROTOC: B  
> ```

You probably need to pass  
#BROKER-ID: BKR144:18026:TCP

---

<div class="post-metadata">

**Author:** ![chris3](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@chris3](https://techcommunity.softwareag.com/u/chris3)\
**Post date:** [April 15, 2010, 3:49am UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/19 "2010-04-15T03:49:14Z")

</div>

Hi Rolf,

I changed the Broker ID before calling USR2007N as you have suggested.

Test #1: Natural Program calling the Natural Subprogram  
Result:

```auto
NAT0954 Abnormal termination AEY9 during program execution.
```

Test #2: .Net Application calling the Natural Subprogram as a web service  
Result: SUCCESS! IT WORKED! FINALLY! AWESOME! WOW!

Note: I almost gave up after Test #1 but for some reason I still tried going for Test #2.

Summary: In order to achieve this  
a) AUTORPC=ON is required in the RPC Server.  
Otherwise this error will come out:  
Broker Error 1001 0016: Callee not found. Library: VRWEBSERVICE, Program: ELVRWS03 ELVRWS03 4910 NAT0082 Invalid command, or Subprogram ELRPC001 does not exist in library., NE=01,ELVRWS03491002O

b) RPCSIZE must be increased in the RPC Server.  
Otherwise this error will come out (even with AUTORPC=ON):  
Broker Error 1014 6971: Natural RPC Server returns: ELVRWS03 4910 NAT6971 Connection error on Client, reason 7 ,RPCXMLOUT /BKR144., NE=01,ELVRWS03491002O

c) Broker ID must be absolute when calling USR2007N, i.e. include Port and Protocol.  
Otherwise this error will come out:  
Broker Error 1014 6971: Natural RPC Server returns: ELVRWS03 4910 NAT6971 Connection error on Client, reason 7 ,RPCXMLOUT /BKR144., NE=01,ELVRWS03491002O

d) Refer to result of Test #1 on error.  
Workaround: If caller is Natural/Mainframe use BKR144 without Port No and TCP.

A Big Thanks To ( In order of appearance 😃 )  
Wolfgang Weil  
Douglas Kelly  
Aldo Teusch  
Rolf Bahlke

I apologize to Wolfgang, Douglas and Aldo if this is what you’ve been trying to tell me but I was just too “slow” to get it.

Thank You Gentlemen! You’re the Best!

Regards,

Chris

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [April 21, 2010, 5:34am UTC](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210/20 "2010-04-21T05:34:37Z")

</div>

You are using a different Broker stub between the online (CICS) and batch (RPC Server). Your CICS stub doesn’t support TCP/IP; batch does. Batch can support SVC if the right stub is used (which would allow “BKR144” as a Broker ID). Stubs vary a bit by EntireX version, so check your documentation.

With EntireX v8.1 you can do TCP/IP from batch or online. (below 8.1 you have to install the Relay Manager…just upgrade!)

[Next page](https://techcommunity.softwareag.com/t/natural-subpgm-as-a-web-service-calling-another-web-service/93210.md?page=2)
