call web service from script and handle it.

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

call web service from script and handle it.

#1

Postby xren » Tue Feb 26, 2013 4:34 pm

Hi,

I will need to call a web service from server side javascript, then process the returned xml.

The web service request need input parameters.

Is there some sample code?

Thanks,
Xiaoli
0 x

Steve
Moderator
Moderator
Posts: 423
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#2

Postby Steve » Wed Feb 27, 2013 8:13 am

Hi Xiaoli,

You can checkout the online documentation for web service adapters:

http://dev-docs.verj.io/ufs/doc/xmlreso ... dapter.htm

or there is an example web service:

http://dev-docs.verj.io/ufs/doc/xmlreso ... kstart.htm

I am not sure the tutorial is that simple, but it gives you an idea.

Basically you need to map form fields to the source fields within your web service resource. You will map the form fields the source fields. The source fields are associated with either the request or response document elements.

All you need to do to call the web service resource is:

Code: Select all

try
{
 resources.MY_WEB_SERVICE.call();
}
catch (e if e.javaException instanceof com.ebasetech.xi.api.exceptions.SoapFaultException)
{
   log(e.javaException.message);
}
I hope this helps.

Steve
0 x

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

#3

Postby xren » Wed Feb 27, 2013 4:36 pm

Thank you Steve. It works for me know.
0 x


Who is online

Users browsing this forum: No registered users and 36 guests