WCF Web Service Puzzle

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
4/24/2010 1:25:13 PM
Gravatar
Total Posts 2

WCF Web Service Puzzle

Hi Joe, 

I know I haven't bought you a beer lately but, if you can figure this one out I will buy you (or anyone else) a six pack!

In mojoPortal you have the RoleService.scv and the AuthenticationService.svc WCF services that I have been consuming with my Silverlight 3 client application (online test for ADHD) and everything works fine.  I am running these services witnh HTTPS and a server certificate. I have created another WCF service called MEDChekService.svc that I have been using in development and staging without issues but, when I deploy to the hosting service the MEDChekService.svc does not work but the AuthenticationService.svc and RoleService.svc both work fine using SSL.

The error that returns when I access the MEDChekService.svc is this:

Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are [http].


------here is a snippet from my web.config for the services --------------

<scripting>

<webServices>

<authenticationService enabled="true" requireSSL="false" />

<roleService enabled="true" />

</webServices>

</scripting>

</system.web.extensions>

 

<system.serviceModel>

 

<services>

<service name="mojoPortal.Web.Services.MEDChekService" behaviorConfiguration="MEDChekServiceBehavior">

<host>

<baseAddresses>

<add baseAddress="https://www.mywebsite.com/Services/MEDChekService"/>

</baseAddresses>

</host>

<endpoint address="" contract="mojoPortal.Web.Services.IMEDChekService" binding="basicHttpBinding" bindingConfiguration="userHttp" />

<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />

</service>

<service name="System.Web.ApplicationServices.AuthenticationService" behaviorConfiguration="AuthenticationServiceTypeBehaviors">

<host>

<baseAddresses>

<add baseAddress="http://www.mywebsite.com/Services/AuthenticationService"/>

<add baseAddress="https://www.mywebsite.com/Services/AuthenticationService"/>

</baseAddresses>

</host>

<endpoint address="https://www.mywebsite.com/Services/AuthenticationService.svc" binding="basicHttpBinding" bindingConfiguration="userHttp" contract="System.Web.ApplicationServices.AuthenticationService" bindingNamespace="http://asp.net/ApplicationServices/v200"/>

<endpoint address="https://www.mywebsite.com/Services/mex" binding="mexHttpsBinding" contract="IMetadataExchange" />

</service>

<service name="System.Web.ApplicationServices.RoleService" behaviorConfiguration="RoleServiceTypeBehaviors" >

<host>

<baseAddresses>

<add baseAddress="https://www.mywebsite.com/Services/RoleService"/>

<add baseAddress="http://www.mywebsite.com/Services/RoleService"/>

</baseAddresses>

</host>

<endpoint address="https://www.mywebsite.com/Services/RoleService.svc" contract="System.Web.ApplicationServices.RoleService" binding="basicHttpBinding" bindingConfiguration="userHttp" bindingNamespace="http://asp.net/ApplicationServices/v200" />

<endpoint address="https://www.mywebsite.com/Services/mex1" binding="mexHttpsBinding" contract="IMetadataExchange" />

</service>

 

</services>

<bindings>

<basicHttpBinding>

<binding name="userHttp">

<security mode="Transport" />

</binding>

</basicHttpBinding>

</bindings>

 

<behaviors>

<serviceBehaviors>

<behavior name="AuthenticationServiceTypeBehaviors">

<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" httpsGetUrl="https://www.mywebsite.com/Services/AuthenticationService.svc"/>

</behavior>

<behavior name="RoleServiceTypeBehaviors">

<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" httpsGetUrl="https://www.mywebsite.com/Services/RoleService.svc"/>

</behavior>

<behavior name="MEDChekServiceBehavior">

<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" httpsGetUrl="https://www.mywebsite.com/Services/MEDChekService.svc" />

<serviceDebug includeExceptionDetailInFaults="true" />

</behavior>

</serviceBehaviors>

</behaviors>

<serviceHostingEnvironment aspNetCompatibilityEnabled="true"> 

<baseAddressPrefixFilters>

<add prefix="https://www.mywebsite.com" />

</baseAddressPrefixFilters>

</serviceHostingEnvironment>

</system.serviceModel>

 

-----------------end snippet--------------

 

Any ideas? This has been driving me nuts for a week and none of the other forums i have searched so for have a fix. :(

Brad

 

 

12/21/2010 2:45:05 PM
Gravatar
Total Posts 22

Re: WCF Web Service Puzzle

Did you ever get a solution to this problem? I am having a similar issue just now and came across your post.

12/22/2010 10:10:06 AM
Gravatar
Total Posts 18439

Re: WCF Web Service Puzzle

I'm really no wcf super guru so not sure if this is helpful or not, but one thing I remember about implementing the Authentication and Role services was that in order to get better control over the service endpoint to support multiple sites based on folder names where I needed to be able to have the folder name as part of the url for the service (and I did not want to have to hard code the service url in Web.config since it would change from installation to installation) I ended up implementing a custom ServiceHostFactory. So if you look in AuthenticationService.svc you'll see this:

<%@ ServiceHost Language="C#" Service="System.Web.ApplicationServices.AuthenticationService" Factory="mojoPortal.Web.mojoServiceHostFactory" %>

and mojoPortal.Web.mojoSeriviceHostFactory.cs can be found in the Web/Components folder.

really I have no idea if any of that has any bearing at all on your custom service or the problems you are having but thought maybe it was worth mentioning.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.