I try to connect to another farm in intense to manipulate an SPList on SharePoint 2007: The following code returns :

the remote server return an error : 500 Internal server error

using (ClientContext context = new ClientContext("http://url/"))
                context.Credentials = new NetworkCredential("user", "mdp", "domain");
                Site siteCollection = context.Site;
                context.AuthenticationMode = ClientAuthenticationMode.Default;
                List list = context.Web.Lists.GetByTitle("nameL");                        
                SPListItem oItem = properties.ListItem;

Any ideas what could be wrong?


The client object model ClientContext is not supported in SharePoint 2007. Use Soap web services instead, see examples

| improve this answer | |
  • you mine that I should create a web service to connect to the other farm ,thanks – Imen Turki Feb 3 '14 at 12:03
  • I guess you would be fine with out of the box web services. Try accessing SOAP services to connect lists residing in other farm. server_name/_vti_bin/Lists.asmx – Falak Mahmood Feb 3 '14 at 12:39
  • the error munche "Unable to automatically step into the server. Connecting to the server machine 'xxx' failed. any ideas, thx – Imen Turki Feb 4 '14 at 15:03
  • Are you are trying to debug the webservice on the server? – Falak Mahmood Feb 4 '14 at 15:58
  • yes I'm trying to debug it with F11 ,but when is use F5 no error appeared .I don't khnow is that a serious error ,or should i ignore it ? beast regards – Imen Turki Feb 4 '14 at 16:23

Client side object model code was introduced in SharePoint 2010. It is not supported in 2007. You will need to use web services or some other service like SPService to work on the lists

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.