1. At the very beginning, I saw this.
Warning 1 The element cannot contain white space. Content model is empty. D:\Azure\SilverlightApplication1\SilverlightApplication1\ServiceReferences.ClientConfig 7 99 SilverlightApplication1
Warning 2 The element 'httpTransport' cannot contain child element 'extendedProtectionPolicy' because the parent element's content model is empty. D:\Azure\SilverlightApplication1\SilverlightApplication1\ServiceReferences.ClientConfig 8 26 SilverlightApplication1
bindingConfiguration="CustomBinding_Service1" contract="ServiceReference1.Service1"
name="CustomBinding_Service1" />
I got the solution from Jimmy Lewis.
Gary, I think it's due to the section:
Can you try removing the
2. Generating proxies
Out of the box, using Add Service Reference or svcutil to generate a proxy to a service hosted either in the development fabric or the cloud fabric will fail. The following workaround can be used:- Host the service either in the Visual Studio ASP.NET Development Server or your local IIS instance
- Use that instance to genereate a proxy
- Modify the endpoint address of the generated proxy to point to the correct location (either in the development fabric or the cloud fabric)
3. Address filter mismatch
At runtime, WCF services may return the following error: The message with To 'http://127.0.0.1:81/Service.svc' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree. The error can be corrected by applying the following attribute to the service class.[ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)]
4. Specifying a relative service address
Normally when adding a service reference, Silverlight will generate a .clientConfig file containing the address of the service. This config file gets pacakged as part of the Azure service and cannot be edited as the service moves from the development fabric, to staging in the cloud fabric, to production in the cloud fabric. This poses a problem since the hardcoded service address will change between these three locations. To use a relative address, you can use the following workaround:- Delete the .clientConfig file
- Recreate the appropriate binding in code, for example: Binding customBinding = new CustomBinding(new BinaryMessageEncodingBindingElement(), new HttpTransportBindingElement());
- Use this method to specify a relative service address: EndpointAddress address = new EndpointAddress(new Uri(App.Current.Host.Source + "/../../Service.svc/binary"));
- Pass the binding and address to the proxy constructor: ServiceClient proxy = new ServiceClient(customBinding, address);
Enjoy.