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

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

  • Creating a booking engine with Web Services
    ... Then I get an xml base response from the web service. ... So XSLT will help me parse the data, I also want to use that data i parse ... They respond back with an XML document. ... Then the customer will pick a flight ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: TCL Dom question
    ... > methods from there to parse the XML document, ... I'd like to load directly from a file location ... set ifd ...
    (comp.lang.tcl)
  • Re: Reading HTML Tables ?
    ... Justin Rogers wrote: ... > then you can load them in an XML Document. ... then you'll have to parse them by hand. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to read configuration section for sub-classes
    ... Not through the configuration interfaces, but you can certainly load web.config into an XML document and then parse the sections directly ...
    (microsoft.public.dotnet.framework)
  • XmlDocument.Load failing with CR must be followed by LF
    ... Dim doc As New XmlDocument ... in VB.NET 2.0 to load an XML document for operating on the nodes thereof. ... System.Xml.XmlTextReaderImpl.DtdParserProxy.System.Xml.IDtdParserAdapter.PushExternalSubset(String systemId, String publicId) ...
    (microsoft.public.dotnet.xml)