Re: Sending existing XML document to a document-literal web service
- From: "RYoung" <r@xxxxxxxxx>
- Date: Sat, 13 Jan 2007 14:08:21 -0600
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?
.
- Follow-Ups:
- Prev by Date: Re: Problem with funky characters
- Next by Date: Re: Redirecting an ASMX page to a new server
- Previous by thread: Problem with funky characters
- Next by thread: Re: Sending existing XML document to a document-literal web servic
- Index(es):
Relevant Pages
|