3

I am developing window phone application. I am consuming the sharepoint web services exposed by the sharepoint 2010. So firstly I am authenticating with the authentication.asmx. I am able to authenticate with the authentication.asmx. Then I am trying to access the list data using the Lists.asmx. For this I am using the following link

http://blogs.msdn.com/b/pstubbs/archive/2010/10/04/developing-windows-phone-7-applications-for-sharepoint-2010.aspx

By following the above link in my code I am getting the System.ServiceModel.ProtocolException at following method

lists.GetListItemsAsync()

I am getting the following error

The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were:

For this scenario I have serached on the internet and I come across the following two link. These are the two link which I am thinking might be useful

http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/9003839f-ec0e-473f-b86d-1b325d5c1a18/

http://msdn.microsoft.com/en-us/library/dd456789.aspx

The first link says that MOSS 2010 doesnt support .NET Framework 4. It supports the .NET Framework 3.5. .NET Framework 4 provides the new CLR. The second link says that if we try to consume .NET 3.5 WCF Service from .NET 4 then we will get the ProtocolException.

Then I am finding me in dought whether I can consume the Sharepoint 2010 list services on my WP7 application or not ?

Can you please tell me whether this is possible or not ? Can you please provide me your suggestions. If I am doing anything wrong then please guide me.

Shailesh Jaiswal
  • 3,606
  • 13
  • 73
  • 124
  • WP7 actually uses CompactFramework version 3.7 but it very much sounds like you're seeing the documented behaviour which indicates that it is not supported. Have you tried usig Fiddler (or similar) to see what is actually being sent. If it came to it you could try making the HTTP requests yourself and not relying on the generated proxies. – Matt Lacey Apr 27 '11 at 07:57
  • http://www.devexpertise.com/2009/02/07/retrieving-sharepoint-list-data-from-silverlight-without-a-custom-wcf-or-aspnet-web-service/ I have referred this link to make the HTTP request but in _responseString variable it is giving complete HTML page. That HTML Page is of List Web Service – Shailesh Jaiswal Apr 27 '11 at 09:16
  • With HTTP web request I am getting the error at code XDocument results = XDocument.Parse(_responseString); I am getting the error {"The 'p' start tag on line 276 position 16 does not match the end tag of 'ul'. Line 278, position 17."}. It is because _responseString is HTML Page – Shailesh Jaiswal Apr 27 '11 at 09:19
  • Have you tried using the Silverlight Client Object model in WP7? It is a lighter wrapper of the SP OM for use in Silverlight. Maybe it will run on WP7?? – John Ptacek Apr 27 '11 at 10:19
  • Have you looked at this? http://weblogs.asp.net/jan/archive/2010/04/22/accessing-sharepoint-2010-data-with-rest-odata-on-windows-phone-7.aspx – Chris Koenig Aug 15 '11 at 07:35

1 Answers1

1

If your SharePoint 2010 installation supports OData, then you can use the technique outlined in Jan Tielens' blog:

http://weblogs.asp.net/jan/archive/2010/04/22/accessing-sharepoint-2010-data-with-rest-odata-on-windows-phone-7.aspx

I've used that technique before and so long as the server is configured correctly, it works like a champ.

/chris

Chris Koenig
  • 2,736
  • 18
  • 17