Question

I'm building a Silverlight application that interfaces with SharePoint Web Services. In a windows forms application I'd create a web reference to my local SharePoint server, then change the Uri of the reference at runtime to point to whatever SharePoint site I wanted to use. Silverlight doesn't seem to have web references, but similar functionality can be achieved with service references. However, there doesn't seem to be a way to change the Uri of the reference at runtime. Is there a way to do this in Silverlight? Or a better way of using SharePoint web Services from Silverlight?

Note: I need to access list item attachments, so owssvr.dll won't be sufficient (I think?)

Was it helpful?

Solution

Seeing as you are using WCF (to reference the Service), you can change the Address of the service like so:

MyServiceSoapClient soapClient = new MyServiceSoapClient();
mySoapClient.Endpoint.Address = new EndpointAddress(URI]);
// do call here 

OTHER TIPS

There seems to be alot missing from this example. soapClient vs. mySoapClient? Endpoint.address is not a property of a service (SVC).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top