Reputation: 252
I have an WCF Service, and it works in localhost, but when published to an IIS server, I wasn't able to access it's methods anymore, the error message was that
"This assembly does not allow partially trusted callers"
Then, I added the following to the Web.config file:
<trust level="Full" originUrl=""/>
Now, I receive this error message:
Cannot obtain Metadata from http://wheremyserviceispublished.net/Service.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.
Does anybody have an clue on how to solve these problems?
Upvotes: 0
Views: 2330
Reputation: 7522
If you publish wcf service in IIS, the default configuration has disclosed the metadata information.
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
You could also assign the metadata address in httpGetUrl attribute. If you want to disclose the metadata information on the endpoint configuration. Try to follow this.
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint>
<behaviors>
<serviceBehaviors>
<behavior name="svbehavior">
<serviceMetadata />
</behavior>
</serviceBehaviors>
And then apply the behavior on the endpoint so that It could take effect.
<service name="WcfService4.Service1" behaviorConfiguration="svbehavior">
Feel free to contact me if the problem still exists.
Upvotes: 1