XML document as input parameter ot WS ?

K

kingski

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
 
J

Jason James

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.
 
E

ee

of course

[WebMethod]

public void SomeFunction(XmlDocument _Transaction)

{

// do somthing
}
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top