[dba-VB] XML DOM to string?

Francisco Tapia fhtapia at gmail.com
Mon Aug 29 22:38:25 CDT 2005


Well the order starts as an XML string received from an online order,
this is captured and imported to a table that temorarily holds the
order as a pending order.  This gets approved by our service dept.,
but at this time I need to take the tablized data and re-convert it to
xml, since the data is on the back end (sql server) I initially
created an "For XML" query, but that proved to be of much use even tho
it was formated correctly.  I then converted the recordset using MSXML
(dom) object.  This works and was the sample xml format I posted
earlier.  I wanted to just pass the dom object, but my sql server wich
makes the soap call takes a string object instead, I thought of just
calling the soap object from Access, but instead went ahead and did it
via sql server, reason for it is that I can save a round trip by
calling the sql server and having sql server update the local tables
instead of pushing data via the client once more...

What I did to make the xml object a string, was to save it as an .xml
file, I then re-open the file w/ an Open file for input standard text
procedure and read the entire file to a string...

i just wondered if at least for the last step i could avoid hitting
the disk, but i think it doesnt' really matter after all this hoop
jumping ;)

On 8/29/05, MartyConnelly <martyconnelly at shaw.ca> wrote:
> Why not grab the intial html string returned down the wire by the soap
> call before you place it in the xmldom.
> It would look something like this. Just strip off the envelope xml code
> and use the soap body.
> Assuming you are using xmlhttp it would be contained  in
> XMLHTTP.responseXML.xml
> rather than XMLHTTP.responseText.
> 
> <?xml version="1.0"?>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <soap:Body><FullZipCodeResponse xmlns="http://webservices.eraserver.net/">
> <FullZipCodeResult>00000-0000</FullZipCodeResult>
> </FullZipCodeResponse>
> </soap:Body>
> </soap:Envelope>
> 
> 
> 
> Francisco Tapia wrote:
> 
> >Well I need the XML formated in the way I metioned earlier, that's
> >because I then make a call to a soap object in which it calls a PICK
> >database (Unidata) to deliver an order.  Originally I had a For XML
> >call from sql server but I was not able to take that result and stuff
> >it into a variable, so I did it in VB, I have a class that I use to
> >create the xml as previously listed, so I finished my document, but
> >wanted to simply make the soap call when I realized that this was an
> >object and not a string, thus it wasn't gonna work.  My current
> >solution is to save it temporarily to the disk and re-read it back to
> >a string variable as a text file using LOF, it works fine, and on my
> >system is actually really quick, but it was just a bother.
> >
> >On 8/29/05, Jim DeMarco <Jdemarco at hudsonhealthplan.org> wrote:
> >
> >
> >>Francisco,
> >>
> >>I'm not quite sure what you need to do.  You can create the XML from data in your database and you can persist it into a file.  Do you need the ability to read the same XML back into your database (with mods or to receive orders)?
> >>
> >>Jim DeMarco
> >>
> >>-----Original Message-----
> >>From: dba-vb-bounces at databaseadvisors.com
> >>[mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of Francisco Tapia
> >>Sent: Monday, August 29, 2005 2:25 PM
> >>To: dba-vb at databaseadvisors.com
> >>Subject: [dba-VB] XML DOM to string?
> >>
> >>
> >>I'm messing around w/ XML and it's quite late I suppose since there
> >>really is so much I do not know... what I'm trying to do, I have a
> >>class that I use to create a complex XML, that is:
> >>
> >>I can save my xmldom object down to a file, but then I'd have to
> >>re-open it and read it all back into a string, and I wondered since
> >>it's in memory if I can just somehow save it to a string instead...
> >>any clues?
> >>Thanks
> >>
> >>
> >>WSOrder>
> >>- <Header>
> >>  <CustID>FO440</CustID>
> >>  <CompanyName />
> >>  <UserType />
> >>  <UserNo />
> >>  <Address1 />
> >>  <Address2 />
> >>  <Address3 />
> >>  <City />
> >>  <State />
> >>  <Zip />
> >>  <Country />
> >>  <Contact />
> >>  <Phone />
> >>  <Notes />
> >>  <ShipMethod />
> >>  <PurchaseOrder />
> >>  <ShipToID />
> >>  <SchedDate />
> >>  <Freight />
> >>  </Header>
> >>- <OrderItems>
> >>- <WSOrderItem>
> >>  <PartNumber>93-1000</PartNumber>
> >>  <Quantity>10</Quantity>
> >>  <SerialNumber>21222</SerialNumber>
> >>  </WSOrderItem>
> >>- <WSOrderItem>
> >>  <PartNumber>22-2222</PartNumber>
> >>  <Quantity>5</Quantity>
> >>  <SerialNumber>50101</SerialNumber>
> >>  </WSOrderItem>
> >>- <WSOrderItem>
> >>  <PartNumber>33-3333</PartNumber>
> >>  <Quantity>33</Quantity>
> >>  <SerialNumber>696969</SerialNumber>
> >>  </WSOrderItem>
> >>  </OrderItems>
> >>  </WSOrder>
> >>
> >>
> >>--
> >>-Francisco
> >>http://pcthis.blogspot.com |PC news with out the jargon!
> >>http://sqlthis.blogspot.com | Tsql and More...
> >>_______________________________________________
> >>dba-VB mailing list
> >>dba-VB at databaseadvisors.com
> >>http://databaseadvisors.com/mailman/listinfo/dba-vb
> >>http://www.databaseadvisors.com
> >>
> >>
> >>
> >>***********************************************************************************
> >>"This electronic message is intended to be for the use only of the named recipient, and may contain information from Hudson Health Plan (HHP) that is confidential or privileged.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited.  If you have received this message in error or are not the named recipient, please notify us immediately, either by contacting the sender at the electronic mail address noted above or calling HHP at (914) 631-1611. If you are not the intended recipient, please do not forward this email to anyone, and delete and destroy all copies of this message.  Thank You".
> >>***********************************************************************************
> >>
> >>_______________________________________________
> >>dba-VB mailing list
> >>dba-VB at databaseadvisors.com
> >>http://databaseadvisors.com/mailman/listinfo/dba-vb
> >>http://www.databaseadvisors.com
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> 
> --
> Marty Connelly
> Victoria, B.C.
> Canada
> 
> 
> 
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com
> 
> 


-- 
-Francisco
http://pcthis.blogspot.com |PC news with out the jargon!
http://sqlthis.blogspot.com | Tsql and More...



More information about the dba-VB mailing list