Hi,
I'm setting up a service that receives a XML document, validates the
document using a schema and then returns a simple result.
I wanted to ask what the best way is of doing this, that is sending
the xml document. So far I've come across 2 way's:
1. Create a webservice that accepts a XMLNode.
2. Use HttpWebRequest to send the document as a stream.
The service would be written in .NET but the clients can be written in
any programing language.
Thanks,
EG
Eric Cherng - 21 Jun 2004 18:17 GMT
elguapo,
Since interoperability is important in your case (your #2 requirement), it
is not suggested that you send any data types that are specific to .NET. If
you plan on sending the XML Document as an XmlNode, make sure to have it
properly serialized as an XML element.
I have researched doing this and came up with 2 ways to pass an XML
Document:
1. By a string type element
2. By using the xsd:any
I have tested both solutions and they both work, however it's up to your
requirements on which you would like to do. I find that #1 is the easiest
solution to implement, but because the XML document is wrapped into a string
type, you won't be able to directly manipulate the XML (without having to
load it into another XmlDocument at least).
$2 solution is a little more difficult to implement (in Java at least, .NET
is pretty simple), but this does have the benefit of having your XML
document as part of the overall XML structure being passed by the web
service.
Hope this helps.
Eric
> Hi,
>
[quoted text clipped - 12 lines]
> Thanks,
> EG
elguapo - 23 Jun 2004 11:35 GMT
Hi Eric,
Yes interoperability is very important for me. I've considered
passing the xml as a string and then loading it into a XMLDocument og
validate-ing it with a schema but I always thought it was not a
recomended way of doing this.
Perhaps I will support more than method of receiving the document.
1. String
2. xmlnode
EG
> elguapo,
>
[quoted text clipped - 39 lines]
> > Thanks,
> > EG
John Jenkins - 22 Jun 2004 21:49 GMT
Hi elguapo,
I am currently implementing a similar project. We adopted the
approach of defining our types as xsd schema, and xml serialization. We used
the xsd tool to generate class definitions of the classes that we will be
sending as paramters and return types.
This was then integrated into the WSDL document. The proxy classes whent hey
reference the web service are provided with class definitions they can use.
In conjunction with this we payed close attention to the WS-Profile document
produced for Interoperability available at msdn.
Hope this helps
Lenin
> Hi,
>
[quoted text clipped - 12 lines]
> Thanks,
> EG
elguapo - 23 Jun 2004 11:45 GMT
Hi Lenin,
This is very interesting.
I've already created a schema document that I was planning to
distribute to the users that are going to be using the webservice.
But it would be better to be able to insert the schema into the wsdl
file.
Do you know of any articles or examples that show how this is done?
Thanks,
EG
> Hi elguapo,
> I am currently implementing a similar project. We adopted the
[quoted text clipped - 28 lines]
> > Thanks,
> > EG