The HttpGetEnabled property of ServiceMetadataBehavior is set to true and the HttpGetUrl property is

Posted by Santosh.Impossible under WCF on 6/20/2014 | Points: 10 | Views : 2708 | Status : [Member] | Replies : 1
Hi WebGurus,

I have a ADFS enabled asp.net mvc2 application and is configured with HTTPS binding (Port No:443) in the IIS. The site is configured as DefaultWebSite in the IIS .I have a WCF service: ChartsService.svc within the asp.net mvc2 project which is used for a silverlight project present in the same solution. After complete testing in the local development environment, I have deployed the code to higher environments. It worked without any issues in all the environments.

All of sudden in Staging server when I tried to smoke the silverlight project, I am getting a WCF error as mentioned below:

System.InvalidOperationException
The HttpGetEnabled property of ServiceMetadataBehavior is set to true and the HttpGetUrl property is a relative address, but there is no http base address. Either supply an http base address or set HttpGetUrl to an absolute address.

System.ServiceModel.ServiceActivationException: The service '/ChartsService.svc' cannot be activated due to an exception during compilation. The exception message is: The HttpGetEnabled property of ServiceMetadataBehavior is set to true and the HttpGetUrl property is a relative address, but there is no http base address. Either supply an http base address or set HttpGetUrl to an absolute address.. ---> System.InvalidOperationException: The HttpGetEnabled property of ServiceMetadataBehavior is set to true and the HttpGetUrl property is a relative address, but there is no http base address. Either supply an http base address or set HttpGetUrl to an absolute address.
at System.ServiceModel.Description.ServiceMetadataBehavior.CreateHttpGetEndpoints(ServiceDescription description, ServiceHostBase host, ServiceMetadataExtension mex)
at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)
at System.ServiceModel.ServiceHostBase.InitializeRuntime()
at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)

The Staging webserver is using IIS7.0

Currently I have following configuration in the web.config:
<behaviors>
<serviceBehaviors>
<behavior name="VATScan.Web.ChartsServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="DemoApp.Web.ChartsServiceBehavior" name="DemoApp.Web.ChartsService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="ServicesBinding" contract="DemoApp.Web.IChartsService" />
</service>
</services>




what surprises me that it is still working fine in all higher environment except in Staging with the same configuration as mentioned above.

Can anyone help me to resolve this issue?

Thanks & Regards,
Santosh Kumar Patro

santosh kumar patro


Responses

Posted by: Santosh.Impossible on: 6/30/2014 [Member] Starter | Points: 25

Up
0
Down
I have modified httpGetEnabled to httpsGetEnabled in the below code in web.config and it resolved the issue.

<behaviors>
<serviceBehaviors>
<behavior name="DemoApp.Web.ChartsServiceBehavior">
<serviceMetadata httpsGetEnabled ="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="DemoApp.Web.ChartsServiceBehavior" name="DemoApp.Web.ChartsService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="ServicesBinding" contract="DemoApp.Web.IChartsService" />
</service>
</services>

santosh kumar patro

Santosh.Impossible, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response