473,804 Members | 4,311 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing XML data as parameter of web service

What's the best way to pass xml data to a web service: as XmlDocument,
or as a string, or....? (the xml data is structured by XSD)

Thanks,
kind regards,

--
Ludwig
http://www.coders-lab.be
May 11 '07
15 8197
On Fri, 11 May 2007 11:06:11 -0400, "Nicholas Paldino [.NET/C# MVP]"
<mv*@spam.guard .caspershouse.c omwrote:
That's definitely the better option. If it is a web service and it
offers a WSDL file, then you can auto generate the proxies and be done with
it.
Thanks for the help!

--
Ludwig
http://www.coders-lab.be
May 11 '07 #11
Why not? Surely a strongly typed object (that represents a well-formed Xml
Document) is better than a crummy old string?
:-)
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Ludwig" wrote:
On Fri, 11 May 2007 07:25:01 -0700, Peter Bromberg [C# MVP]
<pb*******@yaho o.yabbadabbadoo .comwrote:
Ludwig,
ASP.NET webservices can serialize / deserialize and accept an XmlDocument
instance as an input parameter to a WebMethod. Internally this materializes
as an XmlNodeList I believe.
Peter

Yes, I've read that.... but I didn't know if this is the best way to
do it.......

--
Ludwig
http://www.coders-lab.be
May 11 '07 #12
On Fri, 11 May 2007 13:13:02 -0700, Peter Bromberg [C# MVP]
<pb*******@yaho o.yabbadabbadoo .comwrote:
>Why not? Surely a strongly typed object (that represents a well-formed Xml
Document) is better than a crummy old string?
:-)
Yes.... but I want it to be 'open' and platform independent, and I was
not sure whether I should use a .NET framework class like XmlDocument.
If I would use this and send it to another company that does not use
..NET, can they still parse the XML with java for example?

--
Ludwig
http://www.coders-lab.be
May 12 '07 #13
The "Xml" has to go over the wire in string form inside an XML SOAP Envelope.
All SOAP Messages are essentially "strings" - even binary data is
"string-ified". You can check with other vendors' platforms to see how they
treat a complete XML Document as being the payload or a parameter.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Ludwig" wrote:
On Fri, 11 May 2007 13:13:02 -0700, Peter Bromberg [C# MVP]
<pb*******@yaho o.yabbadabbadoo .comwrote:
Why not? Surely a strongly typed object (that represents a well-formed Xml
Document) is better than a crummy old string?
:-)

Yes.... but I want it to be 'open' and platform independent, and I was
not sure whether I should use a .NET framework class like XmlDocument.
If I would use this and send it to another company that does not use
..NET, can they still parse the XML with java for example?

--
Ludwig
http://www.coders-lab.be
May 12 '07 #14
When an XmlDocument is exposed as a parameter or return value of a web
service in ASP.NET, the WSDL produces a schema for that parameter/return
value of a complex type with a single element which allows any element. So
basically, the content is open-ended. I can't imagine another platform that
doesn't handle this in some manner.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Peter Bromberg [C# MVP]" <pb*******@yaho o.yabbadabbadoo .comwrote in
message news:29******** *************** ***********@mic rosoft.com...
The "Xml" has to go over the wire in string form inside an XML SOAP
Envelope.
All SOAP Messages are essentially "strings" - even binary data is
"string-ified". You can check with other vendors' platforms to see how
they
treat a complete XML Document as being the payload or a parameter.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Ludwig" wrote:
>On Fri, 11 May 2007 13:13:02 -0700, Peter Bromberg [C# MVP]
<pb*******@yah oo.yabbadabbado o.comwrote:
>Why not? Surely a strongly typed object (that represents a well-formed
Xml
Document) is better than a crummy old string?
:-)

Yes.... but I want it to be 'open' and platform independent, and I was
not sure whether I should use a .NET framework class like XmlDocument.
If I would use this and send it to another company that does not use
..NET, can they still parse the XML with java for example?

--
Ludwig
http://www.coders-lab.be

May 12 '07 #15
Ludwig wrote:
What's the best way to pass xml data to a web service: as XmlDocument,
or as a string, or....? (the xml data is structured by XSD)
Use string.

I am pretty sure that a web service using XmlDocument will
not be usable from non-.NET languages.

Arne
May 19 '07 #16

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

Similar topics

0
4426
by: gagans | last post by:
Hi My web service has a method which accepts byte array as parameter. <WebMethod()> _ Public Function SendLoan(ByVal data As Byte()) As String Dim filePath As String filePath = System.AppDomain.CurrentDomain.BaseDirectory() & "\WorkingFiles\" objImportExport = New BrainImportExport.BrainImportExport SendLoan = objImportExport.ImportLoanByLoan(data, filePath) objImportExport = Nothing
5
384
by: J. L. Goddard | last post by:
1) Do c# web methods support default parameters ? 2) Can a web method, or a c# method such as: public nullTest( int i ) { return i++; }
2
1465
by: Bob | last post by:
Hi, Can anyone tell me how to resolve this: I am calling a web service from a WinForm app and passing a typed dataset as a parameter. I have added the dataset to the web service project but I get an error telling me that the WinForm dataset can't be converted to the web service dataset - even though they are exactly the same. How do I get around this? I have tried using CType and DirectCast but always
5
3515
by: James Wong | last post by:
Dear all, I've a web service function and it contains a parameter in System.Text.Encoding. I found that the data type of this parameter in caller application becomes MyWebSvcName.Encoding (where "MyWebSvcName" is the name of my web service). I don't know how to assign value to this parameter. (I'm using VB.NET 2003.) Here are some sample codes:
22
25609
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to compile. <WebMethod()> _ Public Function VerifySku(ByVal skus As XmlDataDocument) As DataSet Test program : Dim cartSet As DataSet cartSet = ws.VerifySku(cartSet)
10
3934
by: amazon | last post by:
Our vender provided us a web service: 1xyztest.xsd file... ------------------------------------ postEvent PostEventRequest ------------------------------------- authetication authentication eventname string source string ID string
0
1256
by: amazon | last post by:
I have web service that acceping following parameters.. postev.PostEvent(authentication as ws.authentication, name as string,id as string, exdate as date, parameter() as ws.nameparametervaluepair (I need help in passing this)) Postev.postEvent(auth(), "Test", "1234567", tdt, parameter()) For the first parameter authentication I have: Private Function auth() As ws.Authentication
7
3314
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the object is a reference type? my code is not proving that. I have a web project i created from a web service that is my object: public class ExcelService : SoapHttpClientProtocol {
2
5064
by: Hakan Örnek | last post by:
Hi , I want to parameter passing to my windows sevice. I call service commands like this ; '------------------------------------------------------------ Dim sc As ServiceController sc = New ServiceController("ProsetLogServices") sc.MachineName = "." If sc.Status = ServiceControllerStatus.Stopped Then sc.Start() End If
8
8904
by: =?Utf-8?B?UmF2aQ==?= | last post by:
Hi, I'm trying to pass values of different data-types to a web-service. I thought it would be easier to box these values and pass them as a System.object parameter, like public void webmethod1(object a) where a can be of type string, DateTime, float, etc..
0
9710
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10593
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10329
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9163
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7626
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.