473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Receiving XML Documents

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
Nov 21 '05 #1
4 2544
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

"elguapo" <el*******@yahoo.com> wrote in message
news:b4**************************@posting.google.c om...
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

Nov 21 '05 #2
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

"elguapo" <el*******@yahoo.com> wrote in message
news:b4**************************@posting.google.c om...
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

Nov 21 '05 #3
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

"Eric Cherng" <ericch1@remove_the_dot-hotmai.l.com> wrote in message news:<#J**************@TK2MSFTNGP09.phx.gbl>...
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

"elguapo" <el*******@yahoo.com> wrote in message
news:b4**************************@posting.google.c om...
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

Nov 21 '05 #4
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

"John Jenkins" <jo**********@yahoo.com> wrote in message news:<uF1Cc.272$QU4.40@newsfe4-gui>...
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

"elguapo" <el*******@yahoo.com> wrote in message
news:b4**************************@posting.google.c om...
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

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dave Smithz | last post by:
Hi There, Being quite new to MS-SQL I would like to ask if there is a general opinion of what approach should be taken to storing things like external documents and images in databases. ...
0
by: pottschmidtr | last post by:
I receive the following error 'Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral,...
4
by: Ramiro Barbosa, Jr. | last post by:
All, In regards to the call below, I was wondering why is it that the 'szMessage' receiving buffer results in an empty one, but by printing 'ret' it indicates the number of bytes I am indeed...
8
by: elguapo | last post by:
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...
0
by: André Betz | last post by:
Hi, I've established a TCP-Socket Connection and now I want to receive datas. So I called BeginReceive where I set the receiving buffer and length. Now in the asynchronous CallBack-Function I...
9
by: dgk | last post by:
Is there some built in way to know whether a physical folder path is 'My Documents" for a specific user? I can always use xxx.StartsWith to compare it to the enumeration returned by the Personal...
7
by: Dave | last post by:
Apologies for the newbie question. I have created a vb.net program for my company that is designed to work with Word Templates (about forty of them that we commonly use) that are selected by the...
5
by: Danny | last post by:
I am working on a project in which a number of client applications will be posting xml documents as a byte array to an ASP.NET page on our web server. I am trying to simulate the process and run...
0
by: Danny | last post by:
I am working on a project in which a number of client applications will be posting xml documents as a byte array to an ASP.NET page on our web server. I am trying to simulate the process and run...
1
by: Chris Lieb | last post by:
I have an XML Schema file that I know is correct becuase I currently use it in a VB6 program to validate XML documents. Also, if I load an XML file into VS2005 that is not valid against this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.