NetTalk Central

Author Topic: SOAP Server questions  (Read 4344 times)

frosty

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
SOAP Server questions
« on: January 29, 2008, 02:15:53 PM »
I'm working on an app that will be distributed to a client's customers.  Part of the functionality is based on NetTalk 4.30's example #42 (SOAPServer).

Part of what this app needs to do is check for stock availability.  Based on example #42, that part is working nicely.  I pass a SKU to the SOAPServer app, and the client app receives a reply containing the necessary information.

Two questions:

1)  I need to implement a "synchronization" where on request, the SOAPServer should send certain fields (SKU, product description, a status code, pricing, etc.) back to the client app for any records that belong to that customer's order.  Normally, that would only be 10-30 records, but the potential is there for up to 1000 records being passed back.  What sort of approach should I be looking at to send this data back?  I'm assuming each matching record would be a separate child branch in the XML file?

2)  Is it possible to send back an image and HTML-formatted code as part of the SOAP request, so that checking for stock availability also (optionally) sends back information about about the product?

Thanks.

[L]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: SOAP Server questions
« Reply #1 on: January 31, 2008, 10:50:49 PM »
Hi Leroy,

The first thing to remember is that by leveraging xFiles it's easy to turn "clarion constructions" into XML. xFiles supports Groups, Files, Queues, and Views as "clarion constructions".

In the SOAP example (42) the program uses Groups, and then a single line turns the group into an xml string. For example the TeacherResult group is morphed using
Xml.Save(TeacherResult)

It's obviously trivial to extend the group to include more fields, and if you want multiple records then use a Queue, File or View as the source.

Using this information let's answer your questions below;

1. >>Normally, that would only be 10-30 records, but the potential is there for up to 1000 records being passed back.  What sort of approach should I be looking at to send this data back?

If the data is available in a file, then I would hand-code a VIEW structure, with an appropriate prop:filter & prop:order and simply pass the VIEW to xFiles. If you needed to get more hand-son manipulating the data before it's sent, then build a Queue, or IMM table.

2. >> Is it possible to send back an image and HTML-formatted code as part of the SOAP request,

You can send back anything you like. Add fields to the Group, prime them, send them. At the other end you can enlarge the group, get the data, then do whatever you like with it there.

Because it's XML it's forwards and backwards compatible. Old programs will ignore the extra fields, New programs (getting data from an old Server) will just leave those fields in the group alone.

Cheers
Bruce

frosty

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
Re: SOAP Server questions
« Reply #2 on: February 01, 2008, 12:36:36 PM »
Excellent.  Thanks Bruce.

[L]