"The WSHttpBinding with name WSHttpBinding failed validation because it contains a BindingElement with type System.ServiceModel.Channels.SymmetricSecurityBindingElement which is not supported in partial trust. Consider disabling the message security and reliable session options, using BasicHttpBinding, or hosting your application in a full-trust environment."
- In the web.config for the WcfService1 project, change the endpoint binding form the default wsHttpBinding to basicHttpBinding. Look under configuration/system.serviceModel/services/service and you will see the endpoint element
- Open the project properties page for the WcfService1 project.
- Set the "Secific port" property so an available port number. This will prevent issues later on.
- Under the "Web" section (look to the immediate left), change the "Specific Page" value to ClientBin/WpfBrowserApplication1.xbap
- Open the WcfService1 project properties page
- You need to perform on of these steps so you can reference the XBAP via the http://localhost path.
- Under the Build Events section, set the Post-build event command line so it copies all of the output file to a folder within the WcfService1 project's root directory. In my sample, I created a folder called ClientBin and used XCOPY to copy all of the output file to ClientBin.
- A simpler way to go is to change the Output path property under the Build section to a folder called ClientBin within the WcfService1 project's root folder.
-
- Consume the Service1.svc service in the WpfBrowserApplication1 like you normally would and make a call to the GetData method. The somplest way to do this is to create a button in the Page1.xaml form and make the call in its Click event. Make sure to output the return value of the service call to a MessageBox or something so you can know that the call succeeded.
- Set the WcfService1 project as the StareUp project.
- Hit F5, click the button and you are done.
Comments
Post a Comment