• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Using Sharepoint Lists webservice

New Here ,
Aug 13, 2008 Aug 13, 2008

Copy link to clipboard

Copied

Got a project dumped on my plate that seemed pretty darned simple to start with. Find a way to use the Sharepoint Webservices to update and display data from Sharepoint Lists. Well, that doesn't seem to bad. It's a webservice, it uses soap, just have to connect to it and then pass information back and forth.

Turns out that it wasn't that simple. Basically we're attempting to utilize the Lists.asmx sharepoint service. I have no problem with the methods that take only simple type parameters (strings, integers, etc). But the majority of the methods take one or more "XmlNode" types. These things are in the WSDL as
<s:element minOccurs="0" maxOccurs="1" name="updates">
<s:complexType mixed="true">
<s:sequence>
<s:any />
</s:sequence>
</s:complexType>
</s:element>

So the million dollar question is what the heck do I put in my <cfinvokeargument> to pass that thing. Reading up on the web I find that it shoudl be wanting an XML fragment that looks something like this:
<Batch OnError = "Return" ListVersion="1" ViewName="">
<Method ID="1" Cmd="New">
<Field Name="ID">New</Field>
<Field Name="Title">My Test</Field>
</Method>
</Batch>

Again, seemed easy enough I used <cfxml> and created a fragment. Then I put the variable into my <cfinvokeargument> and blithly expected it to work. Instead I got an error "java.lang.IllegalArgumentException: argument type mismatch". More reading and I realized that I shoudl probably be just passing it as a string. So I just put the XML right into my <cfinvokeargument>. Got a new error:
Web service operation UpdateListItems with parameters {listName={{EF36FF97-F57C-4D98-9087-0630EE337B98}},updates={NewMy Test}} cannot be found.

So now with a string in there it can't find the stub. I've gotten variations on the messages but pretty much it all boils down to the same... it can't seem to access the webservice using those darned complex types. If anyone has any input on this I'd love to hear it. I tried drilling down to see what the underlying types are and turns out that at the end of the day it's an array of MessageElement. But I don't know how to instantiate that either so it didn't really seem to help.


TOPICS
Advanced techniques

Views

518

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 30, 2008 Sep 30, 2008

Copy link to clipboard

Copied

Jed.Jr

Have you found an answer to this question? Can you give a code example for how you are access the methodes with only a simple type.

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 25, 2010 Aug 25, 2010

Copy link to clipboard

Copied

LATEST

Has anyone figured out how to do this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation