Possible to export Excel data into in a SOAP envelope?

M

mdupris

What I'd like to do is export data from Excel into an XML file
directly readable by C#. Currently I'm working with a ListObject, but
it can be transformed as necessary. XmlMaps.Export() does a good job
at creating a plain vanilla XML file. That's not useful, though, if I
want to import the resulting file into an ArrayList within a C#
application.

C# is looking for a SOAP envelope, e.g.
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-
ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://
schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://
schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body> ...

not just an XML file like:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> ...

I've not been able to find any documentation, or examples, that
generating such a SOAP file is even possible in VBA. Has anyone ever
done this, or have hints on where I should look?

= M =
 
J

Jeff Hopper

M -

There are several ways to accomplish your goal, but this sounds like the
perfect job for an XSL T(ransformation)...

I would let Excel output the XML it wants to, and then use C#.NET (e.g., the
XslTransform class) and an XSL file to transform the XML into the desired
format. (There's a good example of this at
http://samples.gotdotnet.com/quickstart/howto/doc/Xml/TransformXml.aspx.)

Having said that, any XML is "directly readable by C#," so it shouldn't
necessarily be a requirement to transform the source XML. When you say, "C#
is looking for a SOAP envelope," what are you doing up to this point that
makes C# request that?

- J
 
M

mdupris

Jeff,

Thanks for your response -- that link looks promising.
In answer to your last question, I've been working with the
SoapFormatter.deserialize() method to bring in outside data. There
are, I'm sure, alternatives, but within the C# app the serialize()/
deserialize() pair is used extensively. I'm trying now to bring Excel
into the loop, particularly as a data supplier.

= M =
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top