473,467 Members | 2,224 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Passing XML to webservice

I have a customer who wants to send us a XML message like this:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<PurchaseOrder xmlns="http://tempuri.org/">
<OrderHeader>
<PONumber>10464</PONumber>
</OrderHeader>
<OrderDetails>
<ItemNumber>63434</ItemNumber>
<NumberOfItems>6</NumberOfItems>
</OrderDetails>
</PurchaseOrder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This message can't be changed. So I build a webservice like this:

[WebMethod]
[SoapDocumentMethod(ParameterStyle=SoapParameterSty le.Bare)]
public string PurchaseOrder(XmlNode XmlPurchaseOrder)
{
//do something nice with XmlPurchaseOrder
}

When I am looking at the contents of XmlPurchaseOrder, I only see the
elements of the first node, OrderHeader. No Orderdetails. Basically, I
would retrieve in my function the whole XML message between the
PurchaseOrder tags, not only the first node. I tried several other
function calls, but I always ends up with the information of the first
node.

Anyone a clue?
Nov 12 '05 #1
1 1809
Add another argument:

public string PurchaseOrder(XmlElement orderHeader, XmlElement orderDetails)
{
....
}
"Chris" <el**********@hotmail.com> wrote in message
news:b2**************************@posting.google.c om...
I have a customer who wants to send us a XML message like this:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body>
<PurchaseOrder xmlns="http://tempuri.org/">
<OrderHeader>
<PONumber>10464</PONumber>
</OrderHeader>
<OrderDetails>
<ItemNumber>63434</ItemNumber>
<NumberOfItems>6</NumberOfItems>
</OrderDetails>
</PurchaseOrder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This message can't be changed. So I build a webservice like this:

[WebMethod]
[SoapDocumentMethod(ParameterStyle=SoapParameterSty le.Bare)]
public string PurchaseOrder(XmlNode XmlPurchaseOrder)
{
//do something nice with XmlPurchaseOrder
}

When I am looking at the contents of XmlPurchaseOrder, I only see the
elements of the first node, OrderHeader. No Orderdetails. Basically, I
would retrieve in my function the whole XML message between the
PurchaseOrder tags, not only the first node. I tried several other
function calls, but I always ends up with the information of the first
node.

Anyone a clue?

Nov 12 '05 #2

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

Similar topics

5
by: hellrazor | last post by:
Hi there, I'm very new to dot net programming and webservices programming. I've managed to create simple webservices so far. Here's my problem: -I've been given a project which needs to...
2
by: Dougie | last post by:
I have a C# application that runs on the local machine. I want to write code that will pass an object from this application to a remote webservice. Is this possible and are there any example...
22
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...
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
2
by: Jay Balapa | last post by:
Hello, Win Forms app is able to connect to my webservice passing credentials as follows- myService.Credentials=System.Net.CredentialsCache.DefaultCredentials; Compact Framework does not...
0
by: pranesh.nayak | last post by:
Hello Group, (tech: C#, VS2005) I'm facing a problem in passing Nullable<DateTimeto a webservice. Below is code in webservice wrapper (reference.cs) used set/get date. When i set date value...
9
by: Greger | last post by:
Hi, I am building an architecture that passes my custom objects to and from webservices. (Our internal architecture requires me to use webservices to any suggestion to use other remoting...
6
by: nickname | last post by:
I want to pass some xml to a web service method, the xml will confirm to a defined schema. Lets say the schema is defined as: <xs:schema attributeFormDefault="unqualified"...
3
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...
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.