Soap AnyType field mapping

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

neilnewman
Ebase User
Posts: 201
Joined: Fri Dec 20, 2013 1:29 pm
Location: Dartford Borough Council
Contact:

Soap AnyType field mapping

#1

Postby neilnewman » Wed May 29, 2019 10:55 am

We have a wsdl that as part of it's response returns a table of type <xs:element name="anyType"/>
How do you access elements within this type of data structure, normally you have an array of elements/fields, but this data type does not appear to work in that way.
0 x

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

Re: Soap AnyType field mapping

#2

Postby Steve » Wed May 29, 2019 4:44 pm

Hi Neil,

The XML element is probably of type XML Any because that particular node can change depending on your request.

One approach is to call the web service and use E4X to iterate through the XML response document of the response:

Code: Select all

//call the web service
resources.myWs.call();
var respDocument = resources.myWs.getDocument("responseDoc");
var resp = new XML(respDocument );

//use E4X to extract the data
var name = resp.customer.name;
....

An easier approach is to use a Copy Adapter to convert the XML Any element into a document that you recognise and map those values to your form.

Documentation regarding the copy adapter and E4X is in the Verj.io documentation.

If you need more help then export the web service and a test form, send to support@ebasetech.com and I will fill in the gaps.

Kind regards

Steve Upton
0 x

neilnewman
Ebase User
Posts: 201
Joined: Fri Dec 20, 2013 1:29 pm
Location: Dartford Borough Council
Contact:

Re: Soap AnyType field mapping

#3

Postby neilnewman » Thu May 30, 2019 8:21 am

Many thanks Steve,
We will try the Copy Adaptor approach, as you suggest it is the easiest route.

Thanks again
Neil
0 x


Who is online

Users browsing this forum: No registered users and 11 guests