Click here to Skip to main content
Rate this: bad
good
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 14: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
0 Sergey Alexandrovich Kryukov 295
1 OriginalGriff 274
2 Shweta N Mishra 216
3 PIEBALDconsult 184
4 CPallini 155
0 OriginalGriff 7,630
1 Sergey Alexandrovich Kryukov 7,022
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,525


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 19 Sep 2012
Copyright © CodeProject, 1999-2014
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