XML document as input parameter ot WS ?

Discussion in 'ASP .Net Web Services' started by kingski, Apr 15, 2005.

  1. kingski

    kingski Guest

    Hei,



    I have to create web service which accepts xml document as parameter:

    <CATALOG>

    <PLANT>

    <COMMON>Bloodroot</COMMON>

    <BOTANICAL>Sanguinaria canadensis</BOTANICAL>

    <ZONE>4</ZONE>

    <LIGHT>Mostly Shady</LIGHT>

    <PRICE>$2.44</PRICE>

    <AVAILABILITY>031599</AVAILABILITY>

    </PLANT>

    <PLANT>

    <COMMON>Columbine</COMMON>

    <BOTANICAL>Aquilegia canadensis</BOTANICAL>

    <ZONE>3</ZONE>

    <LIGHT>Mostly Shady</LIGHT>

    <PRICE>$9.37</PRICE>

    <AVAILABILITY>030699</AVAILABILITY>

    </PLANT>

    <PLANT>

    <COMMON>Marsh Marigold</COMMON>

    <BOTANICAL>Caltha palustris</BOTANICAL>

    <ZONE>4</ZONE>

    <LIGHT>Mostly Sunny</LIGHT>

    <PRICE>$6.81</PRICE>

    <AVAILABILITY>051799</AVAILABILITY>

    </PLANT>

    <PLANT>

    <COMMON>Cowslip</COMMON>

    <BOTANICAL>Caltha palustris</BOTANICAL>

    <ZONE>4</ZONE>

    <LIGHT>Mostly Shady</LIGHT>

    <PRICE>$9.90</PRICE>

    <AVAILABILITY>030699</AVAILABILITY>

    </PLANT>

    <PLANT>

    <COMMON>Dutchman's-Breeches</COMMON>

    <BOTANICAL>Dicentra cucullaria</BOTANICAL>

    <ZONE>3</ZONE>

    <LIGHT>Mostly Shady</LIGHT>

    <PRICE>$6.44</PRICE>

    <AVAILABILITY>012099</AVAILABILITY>

    </PLANT>

    </ CATALOG >



    Update database and return Boolean result.



    Is it possible WS to accept such type of data as parameter? How? Can you
    point me to example /article/ which explain such behavior.



    thanks
     
    kingski, Apr 15, 2005
    #1
    1. Advertising

  2. kingski

    Jason James Guest

    Hi,

    Could you read the XML into a dataset and then send the
    dataset to the WS and a parameter of your function?

    ds.ReadXml(myfilename, XmlReadMode.InferSchema)

    Not sure if this is the most efficient way, but since datasets are
    serialized from a WS it should be easy to serialize one to
    the WS.

    Good luck, and let us knowhow you got on.

    Jason.

    On Fri, 15 Apr 2005 08:56:02 +0200, "kingski" <>
    wrote:

    >Hei,
    >
    >
    >
    >I have to create web service which accepts xml document as parameter:
    >
    ><CATALOG>
    >
    > <PLANT>
    >
    > <COMMON>Bloodroot</COMMON>
    >
    > <BOTANICAL>Sanguinaria canadensis</BOTANICAL>
    >
    > <ZONE>4</ZONE>
    >
    > <LIGHT>Mostly Shady</LIGHT>
    >
    > <PRICE>$2.44</PRICE>
    >
    > <AVAILABILITY>031599</AVAILABILITY>
    >
    > </PLANT>
    >
    > <PLANT>
    >
    > <COMMON>Columbine</COMMON>
    >
    > <BOTANICAL>Aquilegia canadensis</BOTANICAL>
    >
    > <ZONE>3</ZONE>
    >
    > <LIGHT>Mostly Shady</LIGHT>
    >
    > <PRICE>$9.37</PRICE>
    >
    > <AVAILABILITY>030699</AVAILABILITY>
    >
    > </PLANT>
    >
    > <PLANT>
    >
    > <COMMON>Marsh Marigold</COMMON>
    >
    > <BOTANICAL>Caltha palustris</BOTANICAL>
    >
    > <ZONE>4</ZONE>
    >
    > <LIGHT>Mostly Sunny</LIGHT>
    >
    > <PRICE>$6.81</PRICE>
    >
    > <AVAILABILITY>051799</AVAILABILITY>
    >
    > </PLANT>
    >
    > <PLANT>
    >
    > <COMMON>Cowslip</COMMON>
    >
    > <BOTANICAL>Caltha palustris</BOTANICAL>
    >
    > <ZONE>4</ZONE>
    >
    > <LIGHT>Mostly Shady</LIGHT>
    >
    > <PRICE>$9.90</PRICE>
    >
    > <AVAILABILITY>030699</AVAILABILITY>
    >
    > </PLANT>
    >
    > <PLANT>
    >
    > <COMMON>Dutchman's-Breeches</COMMON>
    >
    > <BOTANICAL>Dicentra cucullaria</BOTANICAL>
    >
    > <ZONE>3</ZONE>
    >
    > <LIGHT>Mostly Shady</LIGHT>
    >
    > <PRICE>$6.44</PRICE>
    >
    > <AVAILABILITY>012099</AVAILABILITY>
    >
    > </PLANT>
    >
    ></ CATALOG >
    >
    >
    >
    >Update database and return Boolean result.
    >
    >
    >
    >Is it possible WS to accept such type of data as parameter? How? Can you
    >point me to example /article/ which explain such behavior.
    >
    >
    >
    >thanks
    >
    >
     
    Jason James, Apr 15, 2005
    #2
    1. Advertising

  3. kingski

    ee Guest

    of course

    [WebMethod]

    public void SomeFunction(XmlDocument _Transaction)

    {

    // do somthing
    }
    "kingski" <> wrote in message
    news:...
    > Hei,
    >
    >
    >
    > I have to create web service which accepts xml document as parameter:
    >
    > <CATALOG>
    >
    > <PLANT>
    >
    > <COMMON>Bloodroot</COMMON>
    >
    > <BOTANICAL>Sanguinaria canadensis</BOTANICAL>
    >
    > <ZONE>4</ZONE>
    >
    > <LIGHT>Mostly Shady</LIGHT>
    >
    > <PRICE>$2.44</PRICE>
    >
    > <AVAILABILITY>031599</AVAILABILITY>
    >
    > </PLANT>
    >
    > <PLANT>
    >
    > <COMMON>Columbine</COMMON>
    >
    > <BOTANICAL>Aquilegia canadensis</BOTANICAL>
    >
    > <ZONE>3</ZONE>
    >
    > <LIGHT>Mostly Shady</LIGHT>
    >
    > <PRICE>$9.37</PRICE>
    >
    > <AVAILABILITY>030699</AVAILABILITY>
    >
    > </PLANT>
    >
    > <PLANT>
    >
    > <COMMON>Marsh Marigold</COMMON>
    >
    > <BOTANICAL>Caltha palustris</BOTANICAL>
    >
    > <ZONE>4</ZONE>
    >
    > <LIGHT>Mostly Sunny</LIGHT>
    >
    > <PRICE>$6.81</PRICE>
    >
    > <AVAILABILITY>051799</AVAILABILITY>
    >
    > </PLANT>
    >
    > <PLANT>
    >
    > <COMMON>Cowslip</COMMON>
    >
    > <BOTANICAL>Caltha palustris</BOTANICAL>
    >
    > <ZONE>4</ZONE>
    >
    > <LIGHT>Mostly Shady</LIGHT>
    >
    > <PRICE>$9.90</PRICE>
    >
    > <AVAILABILITY>030699</AVAILABILITY>
    >
    > </PLANT>
    >
    > <PLANT>
    >
    > <COMMON>Dutchman's-Breeches</COMMON>
    >
    > <BOTANICAL>Dicentra cucullaria</BOTANICAL>
    >
    > <ZONE>3</ZONE>
    >
    > <LIGHT>Mostly Shady</LIGHT>
    >
    > <PRICE>$6.44</PRICE>
    >
    > <AVAILABILITY>012099</AVAILABILITY>
    >
    > </PLANT>
    >
    > </ CATALOG >
    >
    >
    >
    > Update database and return Boolean result.
    >
    >
    >
    > Is it possible WS to accept such type of data as parameter? How? Can you
    > point me to example /article/ which explain such behavior.
    >
    >
    >
    > thanks
    >
    >
     
    ee, Apr 29, 2005
    #3
    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. David Furey
    Replies:
    0
    Views:
    1,104
    David Furey
    Jun 29, 2003
  2. Tony Prichard
    Replies:
    0
    Views:
    791
    Tony Prichard
    Dec 12, 2003
  3. Manish Hatwalne
    Replies:
    1
    Views:
    423
    Martin Honnen
    Jul 13, 2004
  4. Ion Chalmers Freeman
    Replies:
    1
    Views:
    547
    Richard Tobin
    Sep 7, 2004
  5. Abdul Mohsin
    Replies:
    1
    Views:
    295
Loading...

Share This Page