Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

Unable to call SharePoint WebServices RSS

8 replies

Last post Apr 14, 2008 04:04 PM by colinbyrne

(0)
  • colinbyrne

    colinbyrne

    Member

    10 Points

    6 Posts

    Unable to call SharePoint WebServices

    Mar 18, 2008 12:19 PM | LINK

    I see that SL2 Beta1 doesn't support any WebService that generates a client proxy with XmlElement values

    i.e the proxy for SharePoint 2007 Lists.asmx has this for the return from GetList:

       private object[] OnEndGetList(System.IAsyncResult result) {
                System.Xml.XmlElement retVal = this.EndGetList(result);
                return new object[] {
                        retVal};
            }

    changing the XmlElements' to object doesn't work, the call is made but null returned.

    This is a major issue so apart from generating your own server-side service any workarounds available?
     

  • anoguei

    anoguei

    Member

    150 Points

    28 Posts

    Re: Unable to call SharePoint WebServices

    Mar 18, 2008 03:24 PM | LINK

    Hi,

     This is exactly the same problem I'm facing right now. Initially I was getting an exception but just realized it was due to the fact of not having the cross domain policy file stored in the root folder of the site. Then when I thought it was going to work, I was getting null in my e.Result on my completed method. I've also did some debugging and noticed that the result is null. I was also wondering if this is due to the fact that I also converted all XmlElements to objects.

    I wish someone from MS could answer this or maybe someone from the Silverlight Web Services team http://blogs.msdn.com/silverlightws/

    If you find an answer please let me know,

     thanks,

    Andy.

  • Yavor Georgiev - MSFT

    Yavor Georgi...

    Member

    217 Points

    43 Posts

    Microsoft

    Re: Unable to call SharePoint WebServices

    Mar 18, 2008 06:11 PM | LINK

    As stated in the docs, XmlElement is not supported in this release:
    http://msdn2.microsoft.com/en-us/library/cc197959(VS.95).aspx

    Thanks,
    -Yavor

     

    If this answers your question, please mark as answered.

    Yavor Georgiev, Program Manager | Silverlight Web Services Team | Microsoft
  • colinbyrne

    colinbyrne

    Member

    10 Points

    6 Posts

    Re: Unable to call SharePoint WebServices

    Mar 18, 2008 06:31 PM | LINK

     

    Sorry Yavor but that answer doesn't help much, I was aware of the docs but which release? Beta 1 or Silverlight 2 itself, i.e. is support planned at all in version 2.

    If not this is extremely unfortunate, being unable to communicate with your primary collaboration product's web services which have been around since 2003 is just wrong. This could affect a lot of other products web services as well.

    +1 vote for this support in v2.

    Colin.

    ps i know I can call using xmlhttp on the page (check my posting http://blogs.flexnetconsult.co.uk/colinbyrne/CommentView,guid,932884be-2276-4236-8df4-f360149b5fd1.aspx) but its not built-in or cross domain,

  • anoguei

    anoguei

    Member

    150 Points

    28 Posts

    Re: Unable to call SharePoint WebServices

    Mar 18, 2008 06:40 PM | LINK

     

    oh forgot to mention that while I was testing the SP web services, I did some HTTP debbuging and the web service was actually returning the GetList response in XML (I could see the full XML in the HTTP Response). But I guess that as mentioned above SL2 was not able to get it back....

    well, hopefully there's another way around. By the way, good post Colin, just came to my mind that if you go back to Silverlight 1.0 you can make it work by using your javascript code behind to call the Web services [:D]

  • colinbyrne

    colinbyrne

    Member

    10 Points

    6 Posts

    Re: Unable to call SharePoint WebServices

    Mar 18, 2008 06:57 PM | LINK

     

    Yep I can see the result being returned but its failing in the deserialization. There doesn't seem to be any way to hook into that i.e to mock up our own classes, XmlElement is fairly trivial to implement, well a lot easier than reproducing the extensive SharePoint web services.

    Even in 2 we could use javascript to make the call and access it from SL but again we shouldn't have to.

  • AyubPatel

    AyubPatel

    Member

    2 Points

    1 Post

    Re: Unable to call SharePoint WebServices

    Mar 23, 2008 10:14 AM | LINK

    I was doing POC for one of my project in silverlight 1.1 at that time i faced the same issue. So i contacted Scott Gu regarding this issue. He forwarded my request to one of his team members and the responses i recieved were as mentioned below. After this response my expectation was that Silverlight 2.0 would resolve this issue. But since Sharepoint SP1 now supports Ajax. I guess with little workaround this issue can be resolved. I have not tried any solution in silverlight 2.0. So i am not sure. If i am sucessful i will let you know.

    From: Bill Hiebert
    Sent:
    To:
    Subject: RE: SilverLight 1.1 Installation issue.
     

    I don’t think asmx style web services are supported in Silverlight 1.1. Looping in Wilco as I am not an expert in this area.

     

    From: Wilco Bauwer  

    That’s correct. We only had support for ASP.NET AJAX webservices, which are basically ASMX webservices which use JSON as a transport format.

     A lot has changed ever since, but that’s not going to help you today. I think your only option is to modify your webservice  and turn it into a ASP.NET AJAX-enabled webservice by adding a [ScriptService] attribute. Additionally you’ll have to merge your application’s configuration with ASP.NET AJAX’s configuration. Hope this helps. Thanks,-Wilco

     

  • Alex DeJarnatt - MSFT

    Alex DeJarna...

    Member

    62 Points

    11 Posts

    Microsoft

    Re: Re: Unable to call SharePoint WebServices

    Apr 14, 2008 12:40 AM | LINK

    There were a few known issues with interop with asmx-based web services, including sharepoint, in Beta 1.  This will be fixed for Silverlight 2. The fix will be available with the next preview release of the VS tools for Silverlight.  No need to switch to AJAX or what-not.

    Alex DeJarnatt
    Connected Framework Team - Silverlight
    Microsoft
  • colinbyrne

    colinbyrne

    Member

    10 Points

    6 Posts

    Re: Re: Unable to call SharePoint WebServices

    Apr 14, 2008 04:04 PM | LINK

    Great, thanks for the update.