Complex XML document via SOAP?

Discussion in 'ASP .Net Web Services' started by -P-, Dec 20, 2004.

  1. -P-

    -P- Guest

    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-
     
    -P-, Dec 20, 2004
    #1
    1. Advertising

  2. -P-

    Mujtaba Syed Guest

    How about this:

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

    Mujtaba.

    "-P-" <> wrote in message
    news:...
    > 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-
    >
    >
    >
     
    Mujtaba Syed, Dec 20, 2004
    #2
    1. Advertising

  3. -P-

    Dan Rogers Guest

    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-" <>
    >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: <>
    >Lines: 12
    >NNTP-Posting-Host: 69.160.30.132
    >X-Trace:

    sv3-MIyfJum18LIVSYolZio0KbabAfjShCRgtymTv5+LouYxXs3AAFKKD/Q4Qj++k8uXNeTRIhag
    NQHooA9!VFx03VLy3a0unyZ8+rBEJ0X2dQNazOvod2YO5Bph0QXuPy6PZrJdPIOXLM2YCOvltMms
    qCw3IF9k!m4NKkeGJrIY3pUqPFA==
    >X-Complaints-To:
    >X-DMCA-Complaints-To:
    >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
    >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-
    >
    >
    >
    >
     
    Dan Rogers, Dec 20, 2004
    #3
  4. Hello -P-,
    This should help
    http://pluralsight.com/blogs/dbox/archive/2004/11/18/3554.aspx

    HTH
    Regards,
    Dilip Krishnan
    MCAD, MCSD.net
    dkrishnan at geniant dot com
    http://www.geniant.com

    > 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-
    >
     
    Dilip Krishnan, Dec 20, 2004
    #4
  5. -P-

    erymuzuan Guest

    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
    -P- wrote:
    > 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-
    >
    >
    >
     
    erymuzuan, Dec 20, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tony Prichard
    Replies:
    0
    Views:
    791
    Tony Prichard
    Dec 12, 2003
  2. Manish Hatwalne
    Replies:
    1
    Views:
    423
    Martin Honnen
    Jul 13, 2004
  3. Vic Russell
    Replies:
    0
    Views:
    450
    Vic Russell
    Sep 29, 2004
  4. Stanimir Stamenkov
    Replies:
    2
    Views:
    795
    Stanimir Stamenkov
    Oct 25, 2005
  5. chriscorbell
    Replies:
    3
    Views:
    896
    Joseph Kesselman
    Sep 20, 2007
Loading...

Share This Page