Link to home
Start Free TrialLog in
Avatar of AlphaLolz
AlphaLolzFlag for United States of America

asked on

How to use SOAP for recordset uploads/downloads

We're in a MS world here (IIS servers, ASP, IE browser).

We know how to retrieve record sets via HTTP requests, but would like to move to SOAP (we think).  This leaves us with the question of how.

We can create recordsets and even turn those into XML structures on either the server or the browser, but don't know how to transfer between the two.  The MS SOAP SDK (and SOAP in general) is a request/response thing and it doesn't seem like there is any way of passing anything beyond primitive data items.

Can anyone provide an example of how to download an XML recordset (XML content with numerous records) from a server to a browser?

Can anyone provide an example of how to upload an XML recordset from the browser to the server (this seems impossible)?
Avatar of BigRat
BigRat
Flag of France image

If you have an XML data structure in a DOM the method xml() returns an XML string. If you pass this through the function escape() you get an entity escaped string. The XMLHTTP object POST request allows you to construct the body of the request, which is always name=value& sequences where the value has been escaped(). Thus I'd pass the XML DOM data from the browser to ANY server just as a string of bytes, ie your body string becomes :-

      str = 'name=' + escape(dom.xml);


Now if you have a query to ASP (getdata.asp?table=users&username=fred) you're probably going to use ADO to get the data out of the database. In which case (at least in ADO+) there is a method in an ADO table which generates an XML string for the data in the table (it's a God awful mapping but it works). You set the ASP response mime type to text/xml and response.write the xml out.

Food for thought?
Avatar of AlphaLolz

ASKER

We need to do this with SOAP though.  I don't know what the limits on a POST are, but we could be sending up dozens or even hundreds of records (each with multiple fields).

We can certainly turn our ADO recordset into XML (ADO supports that), and I guess there's an equivalent method to generate an ADO recordset from XML (I haven't tried that yet).

We don't have a problem sending a query and getting XML back.  That's pretty darn easy.

The big issue/question is that the MS SOAP SDK, which we can use for creating SOAP services within IIS, doesn't seem to have any facility for dealing with anything except single parameters.

Would you suggest declaring a single Variant parameter in the COM object we intent to turn into a service and doing the conversions inside of that?
ASKER CERTIFIED SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You're right, I meant simple, not single.  We have some web services taking 3-4 parameters and returning a value.

I did say we wanted to use SOAP on this.  I don't know of any places where one uses SOAP that isn't a web service, although that might be possible.

So, the issue is how to send up a relatively flat XML structure (from the recordsets) of dozens or hundreds of values to a SOAP service.  Since the MS SOAP SDK exposes COM to the web (essentially via COM properties or parameters to methods), we seem to be limited.  We might not even be able to the MS SOAP SDK.

I've been searching for SOAP examples workings with multiple records, and I haven't ever seen any examples where SOAP is used send data up.  Just down.  We need to do both.
I though that sending up was just like sending down with the array object. It should be possible to select the array object and load it into an ADO table.

I'll think about this over the weekend. Back on Monday.
An answer has not been selected nor has there been any comments added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Delete/No Refund

For more information, feel free to visit: https://www.experts-exchange.com/help/cleanup.jsp  If you have any questions or comments please leave it here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Xikilm
EE Cleanup Volunteer
Points to Rat.