Re: Sending existing XML document to a document-literal web servic
- From: tmcnabb <tmcnabb@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 13 Jan 2007 15:10:27 -0800
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?
- Follow-Ups:
- References:
- Prev by Date: Re: how to pass a value in this webservice?
- Next by Date: Re: Problem sending an email address as parameter in web service
- Previous by thread: Re: Sending existing XML document to a document-literal web service
- Next by thread: Re: Sending existing XML document to a document-literal web servic
- Index(es):
Relevant Pages
|