Hi guys,
Has anybody successfully using spring.nets Spring.ServiceModel.ServiceExporter with WCF??
Some background.....
I'm trying to configure wcf services with spring.net for use in a web application
In my first iteration of the project I suceeded by configuring the service object with spring (I gave it the id requestManagerService) and in the svc file I pointed springs ServiceHostFactory at this object. The svc file looked like this:
<%@ ServiceHost Language="C#" Debug="true" Service="requestManagerService" Factory="Spring.ServiceModel.Activation.ServiceHostFactory" %>
However I do not want to decorate my interface/contract with [ServiceContract] and [OperationContract] attributes. To avoid this you can use springs ServiceExporter.
So I have set up the following in my web config:
<object id="requestManagerService" type="SupplyAndDemand.Messaging.UI.Web.RequestManagerService, SupplyAndDemand.Messaging.UI.Web"
singleton="false">
</object>
<system.serviceModel>
<services>
<service name="requestManagerService" behaviorConfiguration="DefaultBehavior">
<endpoint address="" binding="basicHttpBinding" contract="SupplyAndDemand.Shared.Interfaces.Services.IRequestManagerService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultBehavior">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<object id="requestManagerServiceHost" type="Spring.ServiceModel.Activation.ServiceHostFactoryObject, Spring.Services">
<property name="TargetName" value="requestManagerServiceExporter" />
</object>
<object id="requestManagerServiceExporter" type="Spring.ServiceModel.ServiceExporter, Spring.Services">
<!-- The target object to export-->
<property name="TargetName" value="requestManagerService"/>
<!-- The namespace associated with the wcf service-->
<property name="Namespace" value="http://supplyanddemandapp/"/>
<property name="TypeAttributes">
<list>
<object type="System.ServiceModel.ServiceBehaviorAttribute, System.ServiceModel">
<property name="ConfigurationName" value="requestManagerService"/>
</object>
</list>
</property>
</object>
When I run the web application I get the following error:
"Could not find a base address that matches scheme http for the endpoint with binding BasicHTTPBinding. Registered base adress schemes are []" This error occurs in System.ServiceModel.ServiceHostBase.MakeAbsoluteUri).
Obviously this implies that I need to define a base address.... but I belive my problem is in configuring spring rather than WCF since I am using wcf config which previously worked when I didnt use the exporter.
The spring docs imply configuration is simple and I'm convinced I'm doing something fundamentally wrong - has anybody successfully used the ServiceExporter with an asp.net web app?