c# - I have issue in adding WCF service reference, -


i add console application project solution has services. , "add service reference" when select myservice, error:

there error downloading 'http://localhost/prj/services/myservice.svc/$metadata'. request failed http status 400: bad request. metadata contains reference cannot resolved: 'http://localhost/prj/services/myservice.svc'. content type application/soap+xml; charset=utf-8 not supported service http://localhost/prj/services/myservice.svc. client , service bindings may mismatched. remote server returned error: (415) cannot process message because content type 'application/soap+xml; charset=utf-8' not expected type 'text/xml; charset=utf-8'.. if service defined in current solution, try building solution , adding service reference again.

i tried to change endpoint in config file following element:

<endpoint      address="http://localhost:52644/services/myservice.svc"      binding="mexhttpbinding"      contract="imetadataexchange" /> 

but still same issue.

also when put service url in browser, this:

the server unable process request due internal error. more information error, either turn on includeexceptiondetailinfaults (either servicebehaviorattribute or configuration behavior) on server in order send exception information client, or turn on tracing per microsoft .net framework sdk documentation , inspect server trace logs.

my service config has following:

<system.servicemodel>     <bindings>       <basichttpbinding>         <binding maxreceivedmessagesize="2147483647">           <security mode="none"/>         </binding>       </basichttpbinding>       <basichttpsbinding>         <binding maxreceivedmessagesize="2147483647">           <security mode="transport"/>         </binding>       </basichttpsbinding>     </bindings>      <behaviors>       <servicebehaviors>         <behavior>           <!-- avoid disclosing metadata information, set values below false before deployment -->           <servicemetadata httpgetenabled="true" httpsgetenabled="true"/>            <!-- receive exception details in faults debugging purposes, set value below true.  set false before deployment avoid disclosing exception information -->           <servicedebug includeexceptiondetailinfaults="true"/>           <serviceauthorization principalpermissionmode="none"/>            <!-- service extensions -->           <servicesecurityconfig/>           <messageloggingconfig/>           <errorloggingconfig/>         </behavior>       </servicebehaviors>     </behaviors>      <extensions>       <behaviorextensions>         <add name="servicesecurityconfig" type="myservice.security.servicesecurityconfig, myservice"/>         <add name="messageloggingconfig" type="myservice.logging.messageloggingconfig, myservice"/>         <add name="errorloggingconfig" type="myservice.logging.errorloggingconfig, myservice, version=1.0.0.0, culture=neutral" />       </behaviorextensions>     </extensions>      <protocolmapping>       <add binding="basichttpsbinding" scheme="https"/>     </protocolmapping>      <servicehostingenvironment multiplesitebindingsenabled="true"/>     <!--<servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true"/>-->   </system.servicemodel> 

would great if can help.

thanks


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -