Complex XML document via SOAP?

P

-P-

Can someone point me to an example of passing a complex, highly nested XML document to a WebService via SOAP?

Nearly all the examples I've seen pass a handful of discrete arguments - foo.bar( int a, date b, string c) - which the
SOAP abstraction layer marshalls into an XML structure. I'm interested in seeing what happens when the argument itself
is an XML document, such as an Order/Line/Item structure.

Or would that just be a single String argument? Am I making that too difficult?

-P-
 
M

Mujtaba Syed

How about this:

[SoapDocumentMethod(ParameterStyle=SoapParamterStyle.Bare,
Use=SoapBindingUse.Literal)]
public void MyWebMethod([XmlElement] XmlElement req) { //... }

Mujtaba.

-P- said:
Can someone point me to an example of passing a complex, highly nested XML
document to a WebService via SOAP?
Nearly all the examples I've seen pass a handful of discrete arguments -
foo.bar( int a, date b, string c) - which the
SOAP abstraction layer marshalls into an XML structure. I'm interested in
seeing what happens when the argument itself
 
D

Dan Rogers

Hi,

Sure, this is simple. I am assuming you mean the method signature is what
you are interested in.

Here's a simple purchase order example. Assume the purchase order class is
highly nested, has repeating detail lines, etc.

The method signature for a SavePO method might look like this:

[WebMethod]
PurchaseOrder SavePo (PurchaseOrder data)
{
if (data != null)
return PersistPOClass(data);
}

make sure that the service class is marked as being document literal as
well - this is the default however in ASP.net 1.1.

I hope this helps

Dan Rogers
Microsoft Corporation

--------------------
NNTP-Posting-Date: Mon, 20 Dec 2004 13:28:45 -0600
From: "-P-" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
Subject: Complex XML document via SOAP?
Date: Mon, 20 Dec 2004 14:28:41 -0500
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <[email protected]>
Lines: 12
NNTP-Posting-Host: 69.160.30.132
X-Trace: sv3-MIyfJum18LIVSYolZio0KbabAfjShCRgtymTv5+LouYxXs3AAFKKD/Q4Qj++k8uXNeTRIhag
NQHooA9!VFx03VLy3a0unyZ8+rBEJ0X2dQNazOvod2YO5Bph0QXuPy6PZrJdPIOXLM2YCOvltMms
qCw3IF9k!m4NKkeGJrIY3pUqPFA==
X-Complaints-To: (e-mail address removed)
X-DMCA-Complaints-To: (e-mail address removed)
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.22
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!new
sfeed1.ip.tiscali.net!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!nnt
p.giganews.com!local1.nntp.dca.giganews.com!nntp.adelphia.com!news.adelphia.
com.POSTED!not-for-mail
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.aspnet.webservices:27306
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

Can someone point me to an example of passing a complex, highly nested XML
document to a WebService via SOAP?
Nearly all the examples I've seen pass a handful of discrete arguments -
foo.bar( int a, date b, string c) - which the
SOAP abstraction layer marshalls into an XML structure. I'm interested in
seeing what happens when the argument itself
 
E

erymuzuan

Why not start from XML schema for both Request and response objects,
eventhough web services can be used for RPC, or distributed object it's
best used as messaging infrastructure. Then use xsd.exe to generate the
code for the objects, or better still you can hand crafyed the WSDL

[WebMethod]
public MakeOrderResponse MakeOrder(MakeOrderRequest MakeOrderRequest)
{
}

Regards
Erymuzuan Mustapa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top