# Consuming a Web Service from Natural

**URL:** <https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Code-Samples, Natural-on-Windows-Unix\
**Created:** [December 20, 2006, 6:47pm UTC](https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820 "2006-12-20T18:47:49Z")\
**Posts on this page:** 12\
**Page:** 1

<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:** [December 20, 2006, 6:47pm UTC](https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820/1 "2006-12-20T18:47:49Z")

</div>

For those of you who do not want to follow all the steps in Peter Leibl’s excellent article on calling a Web Service from Natural in the current edition of the TECHniques newsletter here are the programs all zipped up and ready to go.  
[weather.zip](https://techcommunity.softwareag.com/uploads/short-url/UU5sIMMWNY0OUvczoWgpkY0s2V.zip) (3.82 KB)

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 20, 2006, 10:30pm UTC](https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820/2 "2006-12-20T22:30:54Z")

</div>

Interesting for us!

But I guess you have to use Natural 6.2 and we’re currently on 6.1. ☹

---

<div class="post-metadata">

**Author:** ![Tristan](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Tristan](https://techcommunity.softwareag.com/u/Tristan)\
**Post date:** [January 24, 2007, 11:09pm UTC](https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820/3 "2007-01-24T23:09:13Z")

</div>

> [@Stephen Wild](#):
>
> For those of you who do not want to follow all the steps in Peter Leibl’s excellent article on calling a Web Service from Natural in the current edition of the TECHniques newsletter here are the programs all zipped up and ready to go.

Hello Stephen,  
I’ve tried to call the Web Service with your small program - it doesn’t work!  
We’re working with Natural 6.1.1 PL 22 on Windows 2000. I’ve Internet access. We’ve different User-Ids for SPoD and Internet-Access, but you can provide an User and a password with the “Request document” command. So the authority should be no problem.  
But I get always Http-Errors: first http-error 407 and if i try it again http-error 500 (internal server error).  
What can be the problem? Maybe the firewall?

And another question to the xml-“code”: what about lower- and uppercase? I generate the subprograms with the xml-toolkit on unix because it’s not installed on windows. And all tags/values are in uppercases. In the program weather the examine replaces “” with a longer string. But “” isn’t recognized. I changes the examine. But it still doesn’t work.

Can you give me a hint?

Tristan

---

<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:** [January 26, 2007, 3:16pm UTC](https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820/4 "2007-01-26T15:16:23Z")

</div>

I developed and tested this under Natural 6.2.

I must admit that I did cheat a bit with the parser and serializer sub-routines :oops: As you say, when you generate them using the XML toolkit from a PDA everything ends up in upper case, so I had to go in a change all the text constants to match what is in the WSDL. You have to do this in both the serialiser and parser, which come to think of it, may be the reason for your connect error as well.

---

<div class="post-metadata">

**Author:** ![Tristan](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Tristan](https://techcommunity.softwareag.com/u/Tristan)\
**Post date:** [January 27, 2007, 12:19am UTC](https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820/5 "2007-01-27T00:19:38Z")

</div>

Now does it work! :lol:

I did it as you do: all text constants in the subprograms must be in Upper- and lowercases as in the wdsl.  
then it’s always good to make no typemismatches!

I’ve changed the examine statement for substituting the quotes in double-quotes:  
define data local  
0240 1 #HK (A1) CONST\<H’27’\> /\* Hochkomma ’  
0250 1 #GF (A1) CONST\<H’22’\> /\* G

---

<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:** [March 30, 2007, 6:30pm UTC](https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820/6 "2007-03-30T18:30:14Z")

</div>

Following a discussion on SAG-L, I will attempt to do this using mainframe Natural. I’ve sucessfully stowed the programs and am now trying to get them to work, so watch this space for results…

---

<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 16, 2007, 4:01pm UTC](https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820/7 "2007-04-16T16:01:03Z")

</div>

OK, I’ve now got this working on the mainframe using NAT42; what I did was to connect to a NDV server from my Natural on Windows (SPod) using the following parameters: XML=(ON,RDOC=ON,PARSE=ON,RDP=‘’,RDNOP=‘’,RDPPORT=8080),CFICU=ON,CP=AUTO

I then copied the programs over and they work fine.

---

<div class="post-metadata">

**Author:** ![Wilfried\_B](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wilfried_b/32/83_2.png) [@Wilfried\_B](https://techcommunity.softwareag.com/u/Wilfried_B)\
**Post date:** [April 27, 2007, 2:36pm UTC](https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820/8 "2007-04-27T14:36:54Z")

</div>

I did not follow the whole thread, but to forbid Natural to translate double quotes you can use OPTIONS TQMARK=OFF in (all) your programs. So you don’t have to replace the single quotes with double quotes.

---

<div class="post-metadata">

**Author:** ![Bernard\_Grandjean](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Bernard\_Grandjean](https://techcommunity.softwareag.com/u/Bernard_Grandjean)\
**Post date:** [May 24, 2007, 8:15pm UTC](https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820/9 "2007-05-24T20:15:18Z")

</div>

> [@Stephen Wild](#):
>
> For those of you who do not want to follow all the steps in Peter Leibl’s excellent article on calling a Web Service from Natural in the current edition of the TECHniques newsletter here are the programs all zipped up and ready to go.

🙂 I instasll this code on natural 611 xp and it’s running already.  
On natural 422 z/OS we make the installation for parse and request document, but at this time we receive an error:  
NAT8304 HTTP request failed. Reason OPEN : Unexpected internal error condition.  
We are in contact with SAG to resolved this problem.  
Thanks for the code, Bernard Grandjean BIT.

---

<div class="post-metadata">

**Author:** ![gtb](https://avatars.discourse-cdn.com/v4/letter/g/58956e/32.png) [@gtb](https://techcommunity.softwareag.com/u/gtb)\
**Post date:** [January 7, 2008, 9:11pm UTC](https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820/10 "2008-01-07T21:11:12Z")

</div>

Bernard,

Did you ever get a response to the Nat8304 error on the Request Document statement? I am having that problem when trying to access a web service I’ve created on my server. The weather program (included in the literature) works fine, but beyond that, no response to anything else.

gtb

---

<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:** [January 8, 2008, 12:56am UTC](https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820/11 "2008-01-08T00:56:16Z")

</div>

Search Servline24 Knowledge Base for “NAT8304”. There are several fixes prior to NAT423 and some parameters settings that can cause this error - particularly the proxy and port settings.

---

<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:41pm UTC](https://techcommunity.softwareag.com/t/consuming-a-web-service-from-natural/61820/12 "2021-04-02T14:41:00Z")

</div>

Closed on April 2, 2021, 2:41pm UTC


