Click here to Skip to main content
12,956,606 members (71,261 online)
Rate this:
 
Please Sign up or sign in to vote.
Hi Guys,

I have a WCF rest which is working fine in my development machine (Visual Studio web server). But I can not make it work in my QA server which is windows XP with IIS 5.1 (SSL enabled). ("Bad Request" or "not found")
If I go to the IIS and set the mapping ".*" to "aspnet_isapi.dll", then everything will be fine. but for some reason I don't want to do that (for example I will lose the default document behaviour!).

Is there any good way to solve this problem?

Here is my server code:
[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode= AspNetCompatibilityRequirementsMode.Allowed)]
public class AjaxJSON : WCFBase
 
  [WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate= "/Obj/Get/Status/{ObjID}")]                
  public AjaxJSONResponse_ObjIDStatus getImage(string ObjID)
  {
     // Do something and return 
  }
}


and I have this code in my Global.asax

RouteTable.Routes.Add(new ServiceRoute("Rest",
     new WebServiceHostFactory(),
     typeof(Test.AjaxJSON)));


 
here is my config file ( application works in my development machine without this configuration using default configuration)
 
<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <bindings>
        <basicHttpBinding>
            <binding name="AjaxJSONSBinding">
                <security mode="Transport">
                    <transport clientCredentialType="Windows" proxyCredentialType="None"/>
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <behaviors>
        <serviceBehaviors>
            <behavior name="AjaxJSONServiceBehavior">
                <serviceMetadata httpsGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <services>
        <service behaviorConfiguration="AjaxJSONServiceBehavior" name="Test.AjaxJSON">
            <endpoint address="" binding="basicHttpBinding" bindingConfiguration="AjaxJSONSBinding" contract="Test.AjaxJSON"/>
        </service>
    </services>
</system.serviceModel>
 


I have also tried calling the .svc from the Javascript (JQuery). but no chance!

all responses are welcome.

Thank you.
Posted 18-Sep-12 13:32pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

OK, I think there is no way to do that!
But at least I have found why I could not make a call directly to the .svc/...
for the other peaoples who may have the same problem:

I had my service in a folder (WCF) inside my asp.net site which is a normal directory and not a "virtual directory". So I had to call my service like this:
https://server/[virtualFolderName]/WCF/AjaxJSON.svc/Obj/Get/Status/[ObjId]
which did not work!

I remove the AjaxJson.svc and put it directly in the root folder and it solved the problem!

now the path is:
https://server/[virtualfoldername]/AjaxJson.svc/Obj/Get/Status/[ObjId]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,869
CHill60 3,550
Maciej Los 3,302
ppolymorphe 2,080
Jochen Arndt 1,973


Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 19 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100