开发者

Wcf Facility Metadata publishing for this service is currently disabled

开发者 https://www.devze.com 2022-12-26 12:48 出处:网络
I\'m trying to connect to my Wcf service which is configured using castles wcf facility. When I go to the service in a browser i get:

I'm trying to connect to my Wcf service which is configured using castles wcf facility.

When I go to the service in a browser i get:

Metadata publishing for this service is currently disabled.

Which lists a load of instructions which i cant do because the configuration isnt in the web.config.

when I try to connect using VS/add service reference i get:

The HTML document does not contain Web service discovery information.
Metadata contains a reference that cannot be resolved: 'http://s.ibzstar.com/userservices.svc'.
Content Type application/soap+xml; charset=utf-8 was not supported by service http://s.ibzstar.com/userservices.svc.  The client and service bindings may be mismatched.
The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..
If the service is defined in the current solution, try building the solution and adding the service reference again.

Anyone know what I need to do to get this working?

The end client is an iPhone app written using Monotouch if that matters - so no castle windsor on the client side.

cheers

w://

Here's the Windsor.config from the service:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <components>

<component id="eventServices"
               service="IbzStar.Domain.IEventServices, IbzStar.Domain"
               type="IbzStar.Domain.EventServices, IbzStar.Domain"
       lifestyle="transient">
</component>

<component id="userServices"
              service="IbzStar.Domain.IUserServices, IbzStar.Domain"
              type="IbzStar.Domain.UserServices, IbzStar.Domain"
      lifestyle="transient">
</component>

The Web.config section:

 <system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnab开发者_如何转开发led="true"/>
<services>

</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="IbzStar.WebServices.Service1Behavior">
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="true"/>
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

My App_Start contains this:

 Container = new WindsorContainer(new XmlInterpreter(new ConfigResource()))
            .AddFacility<WcfFacility>()
            .Install(Configuration.FromXmlFile("Windsor.config"));

As for the client config - I'm using the wizard to add the service.


Based on the error message here:

The HTML document does not contain Web service discovery information. Metadata contains a reference that cannot be resolved: 'http://s.ibzstar.com/userservices.svc'.

This could mean there's a problem with the way WCF publishes its WSDL file - it typically contains a reference to a separate, external XSD file, which a lot of clients can't deal with (even though it's 100% standards compliant).

Content Type application/soap+xml; charset=utf-8 was not supported by service http://s.ibzstar.com/userservices.svc. The client and service bindings may be mismatched. The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..

This seems to indicate that the client wants to talk SOAP, while the server isn't configured for SOAP (probably for REST instead).

You need to give us some more information about your server and your client side configurations! There's definitely a mismatch of some sort somewhere.... but without more info, all we can do is guess ....


The services section in your web.config is empty. The Windsor WCF Facility does not eliminate the requirement for a configuration; it still needs to be there, and it needs to match the component section of your Windsor.config.

From the quick start - this all needs to go in your web.config:

<services>
    <service name="IbzStar.Domain.EventServices"
             behaviorConfiguration="IbzStar.WebServices.Service1Behavior">
      <endpoint contract="IbzStar.Domain.IEventServices"
                binding="basicHttpBinding"/>
    </service>
</services>


here is the updated configuraton:

<system.serviceModel>
    <!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>-->
    <services>
      <service behaviorConfiguration="userServicesBehaviour" name="userServices">
        <endpoint binding="wsHttpBinding" contract="IbzStar.WebServices.IUserServices" />
        <endpoint binding="basicHttpBinding" contract="IbzStar.WebServices.IUserServices" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="userServicesBehaviour">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>  
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

the problem set up i have is near enough to the example on this site:

http://mikehadlow.blogspot.com/2008/11/windsor-wcf-integration.html

The zip is attached to the blog post - This example has no meta published either.

What would I do to this code to make it work? If I can see that I can make my own work.

w://

0

精彩评论

暂无评论...
验证码 换一张
取 消