Solved

Post multiple XML Get requests to SOAP in one session


Badge +4

Hi

 

I need to post requests to SOAP to retrieve some information about Planning cases back in XML and I have read the article:

 

https://community.safe.com/s/article/working-with-soap-services

 

Our process is more complicated as I need to log in and out of SOAP at the start/end of the process.

 

I created steps in a TestCase in SOAPUI and it worked and I have set up a workbench with the following transformers:

 

Creator

XML Templater (for login)

HPPTCaller (for login - cookies enabled)

XML Templater (to Get data)

HTTPCaller (to Get data)

XML Templater (to logoff)

HTTPCaller (to logoff)

 

While this worked for retrieving one planning case I actually need to retrieve information on multiple cases but cannot get this to work. I tried two things:

 

1) I created a spreadsheet with multiple planning case references in, read this into FME (replacing the Creator) and changed the value in XMLTemplater to use the attribute value (using fme:get-attribute), instead of a hardcoded value.

This appeared to be attempting separately login for each record in the spreadsheet, bring back the data and logoff. However, it seemed to reject features frequently.

 

Even if it did work it would be very inefficient if there were a lot of records and I doubt it would allow that many concurrent logins.

 

2) I put the part of the process that needed to iterate in a new workbench (call it workench a):

 

XLSX Reader

XML Templater (to Get data)

HTTPCaller (to Get data)

 

I then created a separate workbench (workbench b) which had the following:

 

Creator

XML Templater (for login)

HPPTCaller (for login - cookies enabled)

WorkspaceRunner (running workbench A)

XML Templater (to logoff)

HTTPCaller (to logoff)

 

This unfortunately doesn't work as the session is not maintained for the part of the process run by the workspace runner (workbench a).

 

Please could someone let me know how I can log on, iterate though multiple planning cases in XML Templater and finally log off?

 

Many thanks

 

icon

Best answer by daveatsafe 23 June 2022, 18:04

View original

2 replies

Userlevel 2
Badge +17

Hi @markcoopersdc​,

You can use Sampler transformers to extract the first feature and last feature, then use those to trigger the login and logout. You may also want to try using the Sub Template option of the XMLTemplater to build a single data request from multiple features, in order to cut down on network traffic. The XMLFragmenter can be used to split up the reply into individual features again.

Here is an example workflow:

Screen Shot 2022-06-23 at 9.03.49 AM

Badge +4

Thanks you. I didnt use the subtemplate but the sampler works perfectly

Reply