Wcf Integration problem

197 views
Skip to first unread message

RyanL

unread,
Feb 21, 2012, 4:03:30 PM2/21/12
to Castle Project Users
I'm trying to use Castle.Facilities.WcfIntegration.
It works great when debugging in Visual Studio. I am then able to
connect to http://localhost:53349/ServiceName.svc?wsdl. However, once
I publish and deploy to IIS I cannot connect to it (using
http://localhost:95/ServiceName.svc?wsdl. I get the following error:

Error: Cannot obtain Metadata from http://localhost:95/ServiceName.svc?wsdl
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. For help enabling metadata publishing, please
refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata
Exchange Error URI: http://localhost:95/ServiceName.svc?wsdl
Metadata contains a reference that cannot be resolved: 'http://
localhost:95/ServiceName.svc?wsdl'. The remote server returned an
unexpected response: (405) Method Not Allowed. The remote server
returned an error: (405) Method Not Allowed.HTTP GET Error URI:
http://localhost:95/ServiceName.svc?wsdl There was an error
downloading 'http://localhost:95/ServiceName.svc?wsdl'. The request
failed with HTTP status 404: Not Found.

Here is my installer:

public class WcfServiceInstaller:IWindsorInstaller
{
public void Install(IWindsorContainer container,
IConfigurationStore store)
{
var returnFaults = new ServiceDebugBehavior
{

IncludeExceptionDetailInFaults = true,
HttpHelpPageEnabled = true
};
var metadata = new ServiceMetadataBehavior
{HttpGetEnabled = true};

container.AddFacility<WcfFacility>()
.Register(

Component.For<IServiceBehavior>().Instance(returnFaults),

Component.For<IServiceBehavior>().Instance(metadata),
Component.For<IMyService>()
.Named("MyService")
.ImplementedBy<MyService>()
.DependsOn(
Property.ForKey("number").Eq(42))
);
}
}

And my Svc file:

<% @ServiceHost Service="MyService"
Factory="Castle.Facilities.WcfIntegration.DefaultServiceHostFactory,
Castle.Facilities.WcfIntegration" %>

Here is my powershell deploy to set up the app pool and site.

.$env:SystemRoot\System32\inetsrv\appcmd.exe add apppool -Name:
$apppoolname -managedRuntimeVersion:v4.0
.$env:SystemRoot\System32\inetsrv\appcmd.exe add site /name:
$sitename /bindings:http/*:95: /physicalPath:$targetpath

Thanks for any assistance.

Craig Neuwirt

unread,
Feb 22, 2012, 8:08:16 AM2/22/12
to castle-pro...@googlegroups.com
Is it possible to send me a unit test of solution that I can run?

> --
> You received this message because you are subscribed to the Google Groups "Castle Project Users" group.
> To post to this group, send email to castle-pro...@googlegroups.com.
> To unsubscribe from this group, send email to castle-project-u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
>

RyanL

unread,
Feb 22, 2012, 10:27:10 AM2/22/12
to Castle Project Users
I believe this may be a problem with IIS. It runs locally in debug.
First, I did need to install WCF in IIS, following the instructions in
this article: http://www.dotnetthoughts.net/2010/04/23/deploying-wcf-service-in-iis-no-svc-mime-type/
Now, I get a new error about 'Castle.Core' assembly being built by a
runtime newer than the loaded runtime. In IIS my site is using .NET
framework v4.0, so I'm not sure what is causing that problem.

Thanks for any assistance.

Error:
Could not load file or assembly 'Castle.Core' or one of its
dependencies. This assembly is built by a runtime newer than the
currently loaded runtime and cannot be loaded.

On Feb 22, 7:08 am, Craig Neuwirt <cneuw...@gmail.com> wrote:
> Is it possible to send me a unit test of solution that I can run?
>
> On Feb 21, 2012, at 3:03 PM, RyanL wrote:
>
>
>
>
>
>
>
> > I'm trying to use Castle.Facilities.WcfIntegration.
> > It works great when debugging in Visual Studio.  I am then able to
> > connect tohttp://localhost:53349/ServiceName.svc?wsdl.  However, once
> > I publish and deploy to IIS I cannot connect to it (using
> >http://localhost:95/ServiceName.svc?wsdl.  I get the following error:
>
> > Error: Cannot obtain Metadata fromhttp://localhost:95/ServiceName.svc?wsdl
> > 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.  For help enabling metadata publishing, please
> > refer to the MSDN documentation athttp://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata

RyanL

unread,
Feb 22, 2012, 12:09:36 PM2/22/12
to Castle Project Users
Ok that last one I was just using the wrong Application Pool (and
hence the wrong .NET framework).
Now I get a new error that appears to me to be a problem with the
config that Castle constructs? I follow everything the same as the no
config demo, as you can see in my code posted previously.

Error:
Handler "svc-Integrated" has a bad module "ManagedPipelineHandler" in
its module list</h3> </fieldset> </div> <div class="content-
container"> <fieldset><legend>Detailed Error Information</legend>
<div id="details-left"> <table border="0" cellpadding="0"
cellspacing="0"> <tr class="alt"><th>Module</th><td>IIS Web Core</
td></tr> <tr><th>Notification</th><td>ExecuteRequestHandler</td></
tr> <tr class="alt"><th>Handler</th><td>svc-Integrated</td></
tr> <tr><th>Error Code</th><td>0x8007000d</td></tr> </
table> </div> <div id="details-right"> <table border="0"
cellpadding="0" cellspacing="0"> <tr class="alt"><th>Requested
URL</th><td>http://localhost:95/MyService.svc?wsdl</td></tr>
<tr><th>Physical Path</th><td>C:\_APPLICATION\BTLRSPLY.Local
\WebRoot.Wcf\SapNotificationService.svc</td></tr> <tr
class="alt"><th>Logon Method</th><td>Anonymous</td></tr>
<tr><th>Logon User</th><td>Anonymous</td></tr> </table>
<div class="clear"></div> </div> </fieldset> </div> <div
class="content-container"> <fieldset><legend>Most likely causes:</
legend> <ul> <li>Managed handler is used; however, ASP.NET is not
installed or is not installed completely.</li> <li>There is a
typographical error in the configuration for the handler module list.</
li> </ul> </fieldset> </div> <div class="content-container">
<fieldset><legend>Things you can try:</legend> <ul> <li>Install
ASP.NET if you are using managed handler.</li> <li>Ensure that the
handler module's name is specified correctly. Module names are case-
sensitive and use the format
modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule".</
li> </ul> </fieldset> </div> <div class="content-container">
<fieldset><legend>Links and More Information</legend> IIS core does
not recognize the module.

On Feb 22, 9:27 am, RyanL <rlangto...@gmail.com> wrote:
> I believe this may be a problem with IIS.  It runs locally in debug.
> First, I did need to install WCF in IIS, following the instructions in
> this article:http://www.dotnetthoughts.net/2010/04/23/deploying-wcf-service-in-iis...

RyanL

unread,
Feb 22, 2012, 12:14:34 PM2/22/12
to Castle Project Users
Google is my friend.
Sorry to post so much here, these were all IIS issues.
Resolved with the following:
http://wishmesh.com/2010/08/iis-7-5-error-handler-pagehandlerfactory-integrated-has-a-bad-module-managedpipelinehandler-in-its-module-list/

On Feb 22, 9:27 am, RyanL <rlangto...@gmail.com> wrote:
> I believe this may be a problem with IIS.  It runs locally in debug.
> First, I did need to install WCF in IIS, following the instructions in
> this article:http://www.dotnetthoughts.net/2010/04/23/deploying-wcf-service-in-iis...

Craig Neuwirt

unread,
Feb 22, 2012, 12:50:03 PM2/22/12
to castle-pro...@googlegroups.com
I'm sure you're not the only one having these issues so post away!
Reply all
Reply to author
Forward
0 new messages