Re: Sending existing XML document to a document-literal web servic



Thanks Ron. It may not be as difficult as I'm making it out to be.

What I was saying was that I don't want to parse through the existing
document to load it into a CSharp object.

I have a document that conforms to the XSD, and I'm being given a WSDL that
was built from the same XSD. So the WSDL defines a type (productOrderType)
and the clientRequestWithReturn cal defined in the WSDL expects an object of
type productOrderType.

I don't want to parse the existing document and load the productOrderType
object, I just want to send the XML doc. Don't know if I can do this and
still call clientRequestwithReturn, or if I need to go about it another way.

Hope that clarifies. Thanks for the help,

Tim

"RYoung" wrote:

When you say you don't want to parse the object and load it into an object,
can you elaborate on that?

My understanding is that you can use XmlSerializer to read the XML document
into an object, in about 5 lines of code.

I've done exactly that for a project that had XML files in the IODEF format.
I had the XSD schema for the IODEF format, so I used xsd.exe to generate the
IODEF_Document object.

Then used XmlSerializer to load data from the .xml files into an
IODEF_Document object, which was then sent out through the web service.

[WebMethod]
public IODEF_Document Get()
{
XmlSerializer serializer = new XmlSerializer(typeof(IODEF_Document));
IODEF_Document document;
using (FileStream fs = new FileStream("botnet.xml", FileMode.Open))
{
document = (IODEF_Document)serializer.Deserialize(fs);
}

return document;
}

Ron

"tmcnabb" <tmcnabb@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0DD162C2-0184-4890-9F8E-93A31067E993@xxxxxxxxxxxxxxxx
My .Net application consumes a few document-literal BEA Web Services,
which
require me to provide a set of data to be utilized by the service. So
far, I
have generated a CS file from the WSDL, instanciated an object of the type
defined in the provided WSDL (the type of the input parameter), populated
the
object and passed it when making the clientRequestWithReturn call.

In one case though, I have a large and complex existing xml document which
conforms to the schema required by the BEA web service. I do not want to
parse the document and load it into an object, but want to pass the entire
document. Any guidance on how that could be accomplished?



.



Relevant Pages

  • Re: Whats an efficient way of insertring elements into an XML document
    ... > XmlDocument.Load() will load all that into memory each time you open ... and then parse all of the data and build an in memory ... Have you considered using a format other than XML? ...
    (microsoft.public.dotnet.framework)
  • Re: XSLT and SAX.
    ... Sure, but depending on how small of a fragment you are looking for, you may ... just want to load the XML into a System.XML.XMLDocument and parse it that ... We have a large XML file from which we need to extract on a small ...
    (microsoft.public.dotnet.xml)
  • Re: XML editor using MFC
    ... add elements to the tree control. ... XML tree is represented by an HTREEITEM. ... except for the CDATA stuff which is a real pain to parse. ... Error recovery: simplest form, when you find an error, throw a CException-derived class, ...
    (microsoft.public.vc.mfc)
  • Re: Logfile analysing with pyparsing
    ... You can parse it just once, you just have to setup your data structure ... I inferred this from your XML. ... But looking through the logfile is a time consuming process. ...
    (comp.lang.python)
  • Parsing XML data as it arrives from LWP call
    ... I am trying to improve the performance of a Perl application that uses LWP ... I would like to parse the resulting XML data as it's being returned as ... Build request XML input parms ...
    (comp.lang.perl.modules)