c# - wcf service showing error when deployed on server -
i have wcf service running fine on localhost, issue when try deploy on server gives me following error:
could not find base address matches scheme http endpoint binding metadataexchangehttpbinding. registered base address schemes [].
[invalidoperationexception: not find base address matches scheme http endpoint binding metadataexchangehttpbinding. registered base address schemes [].] system.servicemodel.servicehostbase.makeabsoluteuri(uri relativeorabsoluteuri, binding binding, urischemekeyedcollection baseaddresses) +16604769 system.servicemodel.description.configloader.loadservicedescription(servicehostbase host, servicedescription description, serviceelement serviceelement, action`1 addbaseaddress) +1082 system.servicemodel.servicehostbase.applyconfiguration() +156 system.servicemodel.servicehostbase.initializedescription(urischemekeyedcollection baseaddresses) +215 system.servicemodel.servicehost..ctor(type servicetype, uri[] baseaddresses) +475 system.servicemodel.activation.servicehostfactory.createservicehost(type servicetype, uri[] baseaddresses) +43 system.servicemodel.activation.servicehostfactory.createservicehost(string constructorstring, uri[] baseaddresses) +530 system.servicemodel.hostingmanager.createservice(string normalizedvirtualpath) +1413 system.servicemodel.hostingmanager.activateservice(string normalizedvirtualpath) +50 system.servicemodel.hostingmanager.ensureserviceavailable(string normalizedvirtualpath) +1172 [serviceactivationexception: service '/highrisesite/appservices.svc' cannot activated due exception during compilation. exception message is: not find base address matches scheme http endpoint binding metadataexchangehttpbinding. registered base address schemes []..] system.runtime.asyncresult.end(iasyncresult result) +901424 system.servicemodel.activation.hostedhttprequestasyncresult.end(iasyncresult result) +178638 system.web.asynceventexecutionstep.onasynceventcompletion(iasyncresult ar) +107
web-service on server configured this:
<system.servicemodel> <servicehostingenvironment> <baseaddressprefixfilters> <add prefix="http://49.50.72.21/highrisesite/"/> </baseaddressprefixfilters> </servicehostingenvironment> <behaviors> <servicebehaviors> <behavior name="appservicesbehavior"> <servicemetadata httpgetenabled="true"/> <servicedebug includeexceptiondetailinfaults="false"/> </behavior> </servicebehaviors> <endpointbehaviors> <behavior name="jsonbehavior"> <webhttp/> </behavior> </endpointbehaviors> </behaviors> <services> <service behaviorconfiguration="appservicesbehavior" name="appservices"> <endpoint address="http://49.50.72.21/highrisesite/appservices.svc" binding="webhttpbinding" contract="iappservices" behaviorconfiguration="jsonbehavior"> <identity> <dns value="http://49.50.72.21/"/> </identity> </endpoint> <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange"/> </service> </services> </system.servicemodel>
while webservice on local host configured this:
<system.servicemodel> <servicehostingenvironment> <baseaddressprefixfilters> <add prefix="http://localhost:7378/highriseesite/"/> </baseaddressprefixfilters> </servicehostingenvironment> <behaviors> <servicebehaviors> <behavior name="appservicesbehavior"> <servicemetadata httpgetenabled="true"/> <servicedebug includeexceptiondetailinfaults="false"/> </behavior> </servicebehaviors> <endpointbehaviors> <behavior name="jsonbehavior"> <webhttp/> </behavior> </endpointbehaviors> </behaviors> <services> <service behaviorconfiguration="appservicesbehavior" name="appservices"> <endpoint address="http://localhost:7378/highriseesite/appservices.svc" binding="webhttpbinding" contract="iappservices" behaviorconfiguration="jsonbehavior"> <identity> <dns value="http://localhost:7378/"/> </identity> </endpoint> <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange"/> </service> </services> </system.servicemodel>
i not able figure out why running smoothly on localhost shows error on server.
the reason you're getting error you're exposing endpoint on webhttpbinding specifying want wsdl definition exposed also.
metadata endpoints used endpoints exposed on soap bindings, basichttpbinding or wchttpbinding. if want use webhttpbinding cannot have mex binding defined.
Comments
Post a Comment