Web Services Issues

Imports, export, webservices, custom integration work, 3rd party software plugins etc. Questions about these topics live here.
steve
Posts: 384
Joined: Wed Nov 30, 2011 10:20 pm
Been thanked: 77 times

Re: Web Services Issues

Post by steve » Fri Apr 29, 2016 7:45 am

Hmm, can you post a screenshot of how it is defined in the Proclaim Webservice administrator?
(use https://snag.gy/ perhaps and post the jpg url inbetween Img tags)

TomProclaim
Posts: 13
Joined: Thu Mar 26, 2015 10:59 am

Re: Web Services Issues

Post by TomProclaim » Fri Apr 29, 2016 8:06 am

Hi Steve,

Yeah sure. Here you go:
IMG1.jpg
IMG1.jpg (115.56 KiB) Viewed 1917 times
I've tried it with and without the End Point and still no joy. It's reading the WSDL file fine by the looks of it, however when I try and call the web service it just throws that error straight away.

ak__
Posts: 4
Joined: Wed Oct 24, 2018 10:46 am

Re: Web Services Issues

Post by ak__ » Wed Oct 24, 2018 1:52 pm

Hello

I'm new to this forum but I've got the exact same problem as this.

Did you ever manage to resolve this?

Thanks in advance

Andrew

ethusiastp
Posts: 20
Joined: Tue Dec 05, 2017 12:33 pm

Re: Web Services Issues

Post by ethusiastp » Thu Oct 25, 2018 10:59 am

ak__ wrote:
Wed Oct 24, 2018 1:52 pm
Hello

I'm new to this forum but I've got the exact same problem as this.

Did you ever manage to resolve this?

Thanks in advance

Andrew
+1

danny
Posts: 26
Joined: Sun Mar 11, 2012 11:28 pm
Has thanked: 2 times

Re: Web Services Issues

Post by danny » Thu Oct 25, 2018 12:17 pm

wcf webservice i have had no luck with in proclaim. just asmx based. dont suppose sphlive.net will republish as asmx based .... bit of a backwards step
or flatten wsdl file or create new output?
but if ur making ur own then look here
https://docs.microsoft.com/en-us/dotnet ... eb-service
https://docs.microsoft.com/en-us/dotnet ... b-services

or make ur webservice in asmx instead rather than wcf

ak__
Posts: 4
Joined: Wed Oct 24, 2018 10:46 am

Re: Web Services Issues

Post by ak__ » Fri Oct 26, 2018 10:38 am

Thank you Danny. Appreciate the tip.

I've rewritten the wsdl file now by hand and then generated the code from it rather than the other way round.

It looks like proclaim can now at least call the service from a linked action but isn't very interested in returning the value of the response to the mapped the output parameter (op-blah).

I got a guide for doing this from eclipse but it isn't very detailed...could probably have done with a simple end-to-end worked example to base it on.

If I ever get it working, I might write one myself.

Any advice on above appreciated but thanks again.

Andrew

steve
Posts: 384
Joined: Wed Nov 30, 2011 10:20 pm
Been thanked: 77 times

Re: Web Services Issues

Post by steve » Fri Oct 26, 2018 11:49 am

Super-simple end-to-end example of consuming a webservice in Proclaim:

using the example SOAP webservice:
http://www.dneonline.com/calculator.asmx

This example just takes two numbers and uses a webservice to add them together.

1) save the WSDL from your SOAP webservice :
open the URL http://www.dneonline.com/calculator.asmx?wsdl in e.g. IE. File->Save As, and save it as "calculator.wsdl" (consider making a directory in \\prodisk\proclaim\wsdl so that all users have access)

2) in Proclaim Web Services Administration(WSA) Make new Webservice definition:
* ID = "ADD" //or whatever
* Description = "Calculator webservice" //or whatever
* WSDL: \\server\prodisk\proclaim\wsdl\calculator.wsdl //or wherever yours is saved.
click SAVE.
administer in Advanced mode? = NO

You should end up with Proclaim importing the webservice details, and you should be able to expand "CalculatorSoap" to display as below
Image
in its simplest form, you can now exit WSA, and do all the field mapping in Proclaim Maths (e.g. Iinked Action).
You can define Proclaim fields or fixed values within the WSA program if you like, but for the moment we won't (and it's often easier to maintain this way)

3) Exit Web Services Administration

4) Create a new Linked Action "ADDITION" or whatever.

5) Click the "Call a Webservice" wizard.
Choose your new webservice
choose Service: CalculatorSoap (not CalculatorSoap12)
Choose Function: Add
tick all 'Select paraters to be localised:
(This means that instead of passing values to the webservice via fields or values defined in Web Services Administration utility, we pass values to the webservice from local variables named in the Proclaim Maths itself. The names of these variables are produced for you by the wizard)
Image
This will produce a line of code something like:

Code: Select all

WEBSERVICE ("ADD", "CalculatorSoap", "Add", "ip-intA", "ip-intB", "op-AddResult")
Note here that the wizard has created local variables:
ip-intA
ip-intB
op-AddResult

We pass input values via the the 'ip' input variables, and receive the result back through the 'op' variable.

6) Modify your Linked Action so it now reads:

Code: Select all

# store input values. n.b. this could be from a DB field
#
ip-intA = 5
ip-intB = 4
#
# Call the webservice
WEBSERVICE ("ADD", "CalculatorSoap", "Add", "ip-intA", "ip-intB", "op-AddResult")
#
# we can check the success or otherwise of the webservice call using the 'return-value' variable, that will give us some indication of error
MESSAGE ("Return-value: ",return-value)

#
IF return-value = "" then
   # everything worked
   MESSAGE ("Success! ",NEWLINE , ip-intA , " + " , ip-intB , " = ", op-AddResult)
   # if desired, store the output in a database field
   PUT (op-AddResult, {my number field.Number)
ELSE
   MESSAGE ("Some error: ",return-value)
END
7) Save your code. Add a button to a screen and add the linked action for testing

8) run it!

You should see MESSAGE popups:
"Return-value: " //return value is blank - good - no errors
"Success! 5 + 4 = 9"

That's the basics. You can do much more - such as
* receive XML back from a webservice and import it with XML Data Template.
* define fixed fields and values in Web Services Administration so that e.g. username and password need not be added to Procalaim Maths each time
* send and receive BASE64 encoded WORD/PDF/files
* satisfy endpoints that require authentication

Some gotchas for more advanced webservices.
1) https endpoints. You must ensure the certificates are installed in Openedge on each machine that calls the webservice
2) SOAP1.2. Word on the grapevine is that these are better supported in later versions, but for ease stick to SOAP1 services.
3) WCF published webservices. The WSDL formats are not as well supported by the Proclaim Webservice parser, especially for complex datatypes (e.g. returning multiple values via a user-defined object via default Serialiser). If you are writing your own, consider sticking with asmx.
4) Overwriting or updating a pre-existing Web Service Administration entry can be a headache, e.g. if you are upgrading an existing service with more functions, this can sometime corrupt any field mapping you have defined in WSA.
5) If a webservice maths call crashes in Main Case Handling, sometimes each subsequent webservice call will continue to fail to run properly until you quit and restart proclaim, even if you think you've fixed the issue.

ak__
Posts: 4
Joined: Wed Oct 24, 2018 10:46 am

Re: Web Services Issues

Post by ak__ » Fri Oct 26, 2018 7:29 pm

Wow steve! Thank you for this. I will try first thing on Monday morning and will report back.

Hugely appreciated.

Hope you all have a good weekend.

Andrew

ak__
Posts: 4
Joined: Wed Oct 24, 2018 10:46 am

Re: Web Services Issues

Post by ak__ » Fri Oct 26, 2018 8:13 pm

Not gonna lie...I couldn't wait until Monday. This example worked great.

Thank you so much for the effort to share this.

I will go back through what I did and correct...I think the (latest) key mistake I've made was to answer "Yes" when it asks if I want to edit in advanced mode.

Big thank you again for the example.

Andrew

Post Reply