[ACCEPTED]-WCF hosting: Can access svc file but cannot go to wsdl link-wsdl
had the same problem. i fixed it by adding 4 httpsGetEnabled to serviceBehaviors>behavior 3 like this:
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
maybe it helps someone else. dont 2 think that u need this hint after 4years 1 =)
You basically need three things to enable 9 browsing to your WSDL for a WCF service:
- a service behavior which enables service metadata
- set the httpGetEnabled=True on that service metadata behavior to allow http browsing to that metadata
- a mex endpoint on your service
So 8 your config on the server side might looks 7 something like this (plus a bit more stuff):
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MetadataBehavior">
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="MetadataBehavior" name="YourService">
<endpoint address=""
binding="basicHttpBinding"
contract="IYourService" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
Points 6 1 and 2 are handled by this line here:
<serviceMetadata httpGetEnabled="true" />
You 5 need to reference that service behavior 4 in your <service>
tag for it to become active.
Point 3 3 (MEX endpoint) is this section here:
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
For 2 http, use the mexHttpBinding
, and the IMetadataExchange
contract is a WCF 1 system contract for metadata exchange .
I know that answer it's so late but I had 6 the same problem and the solution was:
Add 5 tags [ServiceContract]
and [OperationContract]
on interface that it is implemented 4 on service .svc
. Visual Studio create interface 3 when you select WCF Service
but I deleted the interface 2 and I created my own interface.
[ServiceContract]
public interface IService1
{
[OperationContract]
void DoWork();
}
I hope to 1 help somebody.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.