Hi,
I got the error "Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata."
i know its because of some problem with end point, but i am not able to figure what would be a issue.. Can anybody guide me by looking at this code?
Well, you have a service behavior called "ServiceBehavior" that enables metatada.
However, in your service WASHosting.Service1, you reference the behaviorConfiguration "metadataBehavior", which does not exist. Also, you specifically set the behaviorConfiguration for the BasicHttpBinding endpoint of that service to "WASHosting.Service1"
which makes no sense. Change your behaviorConfiguration to the actual named service behavior you created called "ServiceBehavior". Note that this is XML so capitalization is important.
Darrell Norton, MVP
Darrell Norton's Blog Please click "Mark as Answer" if this helped you.
Marked as answer by peter pi - msft on Oct 11, 2011 02:38 AM
"you specifically set the behaviorConfiguration for the BasicHttpBinding endpoint of that service to "WASHosting.Service1" which makes no sense" i have changed it to servicebehavior but it is not working can you paste the new code after
changes..
abhijithmani...
Member
398 Points
169 Posts
Metadata not exposed ..
Oct 04, 2011 05:08 AM|LINK
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <services> <service name="WASHosting.Service1" behaviorConfiguration="metadataBehavior"> <endpoint address="" binding="BasicHttpBinding" behaviorConfiguration="WASHosting.Service1" contract="WASHosting.IService1"/> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> <behaviors> <serviceBehaviors> <behavior name="ServiceBehavior"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>DarrellNorto...
All-Star
86703 Points
9638 Posts
Moderator
MVP
Re: Metadata not exposed ..
Oct 04, 2011 10:25 AM|LINK
Well, you have a service behavior called "ServiceBehavior" that enables metatada.
However, in your service WASHosting.Service1, you reference the behaviorConfiguration "metadataBehavior", which does not exist. Also, you specifically set the behaviorConfiguration for the BasicHttpBinding endpoint of that service to "WASHosting.Service1" which makes no sense. Change your behaviorConfiguration to the actual named service behavior you created called "ServiceBehavior". Note that this is XML so capitalization is important.
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.
abhijithmani...
Member
398 Points
169 Posts
Re: Metadata not exposed ..
Oct 04, 2011 11:44 AM|LINK
Hi your reply was helpful but what you mean
"you specifically set the behaviorConfiguration for the BasicHttpBinding endpoint of that service to "WASHosting.Service1" which makes no sense" i have changed it to servicebehavior but it is not working can you paste the new code after changes..
Thank you
Peter pi - M...
Star
12871 Points
1786 Posts
Re: Metadata not exposed ..
Oct 11, 2011 02:38 AM|LINK
Hi,
As DarrellNorton mentioned, you need to change the ServiceBehavior to metadataBehavior.
1.Using
<behaviors>
<serviceBehaviors>
<behavior name="metadataBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
Instead of
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
2. Add endpointBehaviors node under <behaviors> tag and name it as myBehavior.
For example:
<behaviors>
<endpointBehaviors>
<behavior name="myBehavior">
<callbackDebug includeExceptionDetailInFaults="true" />
</behavior>
</endpointBehaviors>
</behaviors>
Then you can apply it to behaviorConfiguration property of Endpoint like below.
<endpoint
address=""
binding="BasicHttpBinding"
behaviorConfiguration="myBehavior"
contract="WASHosting.IService1"/>
Best regards,
Peter
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework