views:

702

answers:

4

Hey

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 aspNetCompatibilityEnabled="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.

A: 

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 ....

marc_s
Hey - thanks for the help - right now - i'm trying to get the instructions at http://wiki.monotouch.net/HowTo/WebServices/Using_WCF goingso i'm at the Run C:\Program Files\Microsoft SDKs\Silverlight\v3.0\Tools\SlSvcUtil.exe /noConfig stage.even if i try to add the reference in visual studio it fails - which is a bit odd?w://
cvista
@cvista: no, if your service doesn't publish any metadata - how should the `slsvcutil` be able to figure out what the client will look like?? You need to fix the "no metadata" problem on the server side first - before that, nothing will work....
marc_s
A: 

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>
Aaronaught
this was actually ok using the facility i've answered below.
cvista
A: 

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://

cvista
You've tried to set up two HTTP endpoints for the same address. You can't have both a `basicHttpBinding` endpoint and `wsHttpBinding` endpoint without changing the address of one of them.
Aaronaught
A: 

The answer to this is to configure everythign in code - you get more expressive ability and it seems to "just work"

cvista