NetTalk Central

Author Topic: Processing return data from web service in server app  (Read 5374 times)

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Processing return data from web service in server app
« on: February 15, 2016, 06:29:09 PM »
Hi,

I am trying to use a external web service to retrieve data for a few fields in a web server form.    The call is simple enough but I am having trouble with processing the returned data in the context of a web server app instead of a windows client.    I have looked through several demos and the NT documents and user groups but haven't been able to find an example or instructions that fit the situation.   If I have missed it, a quick pointer would be greatly appreciated.    If not,  how do you do this?   Many thanks.

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Processing return data from web service in server app
« Reply #1 on: February 16, 2016, 03:29:23 AM »
Hi Casey,

I did one recently where the user enters a quote ref# in my app, it consumes a suppliers web service and then updates a whole bunch of fields and data in the form in my app.

Basically after they enter the ref# I have some server side code that sends the ref#, username and password to the suppliers web service. The supplier then returns the data in an xml structure. This structure is parsed and the relevant data extracted and session values in the form updated. The fields on the form are then refreshed and hey presto!

So step1 is just call the web service from your form and get the data back.

HTH's

Kev


CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Processing return data from web service in server app
« Reply #2 on: February 16, 2016, 10:48:16 AM »
Thanks, Kevin

That is what I am trying to do, but it is the mechanics of receiving the returned xml data in the form procedure that I am having trouble with.  Parsing isn't a problem, just delivering the return data to the right place to be processed.  I am betting it is something really basic that I am missing.

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Processing return data from web service in server app
« Reply #3 on: February 16, 2016, 09:55:37 PM »
Have you got the API running from a clarion window procedure with (NetWebServerWorker p_Web) prototype? I think I normally just import this procedure in from a demo app and then butcher it.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11297
    • View Profile
Re: Processing return data from web service in server app
« Reply #4 on: February 16, 2016, 10:17:11 PM »
Hi Casey,

this might eb a good topic for the webinar on Thursday, because it all depends on how you are _triggering_ the request.

the basic idea is;

Let's say you have a button on the form.
Press the button.
Triggers the WebClient call.
On return from the web client call the _session values_ of the affected form fields are updated.
the button must be set to "reset" those form fields.

cheers

Bruce