473,322 Members | 1,188 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,322 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 2540
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.