Thanks for the tips, but I've actually done everything you suggested with no luck so far. I think the only thing I didn't try was forcing SSL on the service and directly setting the request to use the full https url. I will give that a try and report back. As far as the ssl.config goes, I tried adding an entry for the service with the state attribute set to ignore and it didn't seem to have any effect.
*EDIT: Okay, so the problem with making the service always use SSL is that cross-domain requests are not allowed by browsers. I should have realized that before I even tried it. I tried to get around it by enabling JSONP for the service proxy, and setting crossDomainScriptAccessEnabled=true for the binding, but now I am getting a 405 Method Not Allowed response to the service calls.
One thing I forgot to add was that I originally had this set up where the service was added to pages (in the master pages) in the ScriptManager using a ServiceReference. The problem that I was having with that was when it tried to pull the JS service proxy code, it would request it from
http://www.mydomain.com/Services/MyService.svc/js (or jsdebug in debug mode), and the redirect was dropping the last part of the path (trying to send it to
https://www.mydomain.com/Services/MyService.svc). Seems like something in Able's redirection code was messing up the URL parsing, but since it is happening in the CommerceBuilder.Licensing module, I really can't say for sure. To get around this, I copied the generated service proxy code and saved it to my scripts folder and added that as a ScriptReference instead. I don't see any way around this, which is a problem to me. If something in their design is preventing the use of standard asp.net code, then to me that means there is a flaw in their design.
*EDIT2: Okay, I think I got it working. It's working in my development environment at least. Will need to verify that it works in production as well. Here is the thing.... I went back to my original implementation using the ServiceReference. I then put TWO entries in the ssl.config file:
Code: Select all
<directory path="services/myservice.svc" state="Ignore"/>
<file path="services/myservice.svc" state="Ignore"/>
The problem with the original redirection is it was treating URLs with the format
http://www.myservice.com/Services/MyService.svc/stuff as subdirectories, so both the file itself AND the file as a directory need to be ignored. Doing this seems to have worked. Simple fix that I just didn't think of. For anyone else that runs into a similar issue, my service is set up as follows:
web.config
Code: Select all
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
...stuff not related to my service...
</system.serviceModel>
ssl.config
Code: Select all
<directory path="services/myservice.svc" state="Ignore"/>
<file path="services/myservice.svc" state="Ignore"/>
MyService.svc
Code: Select all
<%@ ServiceHost Language="C#" Service="AbleCommerce.Services.MyService" CodeBehind="MyService.svc.cs" Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" %>
MyService.svc.cs
Code: Select all
...using stuff...
namespace AbleCommerce.Services
{
[ServiceContract(Namespace = "AbleCommerce.Services", SessionMode = SessionMode.Allowed)]
public interface IMyService
{
[OperationContract]
void SomeMethod();
...etc....
}
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
#if DEBUG
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
#endif
public class MyService : IMyService
{
public void SomeMethod() { /* stuff */ }
...etc...
}
}
master pages
Code: Select all
...stuff...
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
<Services>
<asp:ServiceReference Path="~/Services/MyService.svc" />
</Services>
</asp:ScriptManager>
...stuff...