I created a WCF service, here is the configuration section:
<system.serviceModel> <services> <service name="McActivationApp.EnrollmentService" behaviorConfiguration="McActivationApp.EnrollmentServicBehavior"> <endpoint address="" binding="webHttpBinding" contract="McActivationApp.IEnrollmentService"/> <endpoint address="mex" binding="mexHttpBinding" contract="McActivationApp.IEnrollmentService" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="McActivationApp.EnrollmentServicBehavior"> <serviceMetadata httpGetEnabled="True"/> <serviceDebug includeExceptionDetailInFaults="False" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> </system.serviceModel>
I connected to the service using WcfTestClient, added the service and can only call methods that are in the "IEnrollmentService (MetadataExchangeHttpBinding_IEnrollmentService)" section (they work as expected).
But the methods from another section of IEnrollmentService (WebHttpBinding_IEnrollmentService) cannot be called. When I try to call any of them, I get the following error:
Failed to call the service. Possible reasons: the service is disabled or unavailable; client side configuration does not match proxy; existing proxy is invalid. Refer to the stack trace in detail. You can try restoring the start of a new proxy server, restoring the default setting, or updating the service.
Error Details:
The Address property on ChannelFactory.Endpoint was null. The ChannelFactory Endpoint must have a valid Address specified. at System.ServiceModel.ChannelFactory.CreateEndpointAddress(ServiceEndpoint endpoint) at System.ServiceModel.ChannelFactory`1.CreateChannel() at System.ServiceModel.ClientBase`1.CreateChannel() at System.ServiceModel.ClientBase`1.CreateChannelInternal() at System.ServiceModel.ClientBase`1.get_Channel() at EnrollmentServiceClient.UpdateEnrollmentProfile(String enrollmentId, String siteName, String deployServerName, Int32 methodId, String deviceClass, String deviceName, String registrationCode)
Question 1: Do I understand correctly that for the case of calling the IEnrollmentService (WebHttpBinding_IEnrollmentService) methods, I need to additionally specify some endpoint?
Question 2: Can I get working?
Question 3: Do I have to take care of them (how can I call methods from my "user" application)?
Budda source share