The easiest way to access a service via a BasicHttpBinding
is to generate the client code from SlSvcUtil.exe, which is a silverlight utility application.
SLsvcUtil.exe /directory:C:\users\me\Desktop http://URL.svc
That should create a MyInterfaceClient class inside of the file it generates.
Then in your code you can do:
var binding = new BasicHttpBinding() {
Name = "BindingName",
MaxBufferSize = 2147483647,
MaxReceivedMessageSize = 2147483647
};
var endpoint = new EndpointAddress("URL.svc");
MyInterfaceClient client = new MyInterfaceClient(binding, endpoint);
client.WSFunctionCompleted += (object sender, WSFunctionCompletedEventArgs e) => {
//access e.Result here
};
client.WSFunctionAsync("XXXXXX");
Your mileage may vary. Let me know if this works.