What <Field Name> does webservice accept?

R

raydio

Hi.

This is probably a daft question, but for the life of me I am unable
to find out what fields a webservice accepts.

The service is wss Lists.UpdateListItems

How do I find out what <Field Name=""> it or any other service
accepts?

Example xml sent:

<Method ID="1" Cmd="New">
<Field Name="Title">D-day for home info packs</Field>
<Field Name="PublishedDate">2007-08-01 17:51:29</Field>
</Method>

Thanks.
 
J

John Saunders [MVP]

Hi.

This is probably a daft question, but for the life of me I am unable
to find out what fields a webservice accepts.

The service is wss Lists.UpdateListItems

How do I find out what <Field Name=""> it or any other service
accepts?

Example xml sent:

<Method ID="1" Cmd="New">
<Field Name="Title">D-day for home info packs</Field>
<Field Name="PublishedDate">2007-08-01 17:51:29</Field>
</Method>

Do you have access to the WSDL for the service? What is the type of the Name
attribute? Is it restricted using enumerations? If so, that's your answer.

Most likely it is not restricted that way, so you'll have to ask the people
who wrote the service. That is to say, look in the documentation.

A method like this is meant to be generic and extensible without necessarily
needing to change the code of the client. Perhaps there is a
Lists.GetMetaData call or something like that.
 
R

Ray Proffitt

The doco for WSS v3 isn't really much use...

use the GetList(slist) method to bring back the whole schema, then
loop through the fields.... something like this:


XmlNode ndList = oLists.GetList("yourlist");
// Iterate through each field
foreach (XmlNode ndField in ndList.FirstChild.ChildNodes)
{
foreach(XmlAttribute a in ndField.Attributes)
{
lListSchema.Text +=
(string)ndField.Attributes[a.Name].Value;
}
}
 

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

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top