我有一个小的我刚刚写的使用下面的uri模板。WCF不绑定到网址
[UriTemplate = "xml/{user_id}/{content_id}/{time}")]
在我的本地开发机器
/blahblah.svc/xml/1/1/1
在我的远程机器
/myapp/blahblah.svc/xml/1/1/1
作品,但是当我尝试将其解析为远程机器我收到500错误,当我查看500错误时,服务器似乎正在尝试在blahblah.svc/xml /中查找web.config。
它似乎没有正确地绑定到URL后blahblah.svc。
在我的web.config我有: -
<system.serviceModel>
<services>
<service name="JASWebservices.JCPSRest" behaviorConfiguration="ServiceBehaviour">
<endpoint address ="" binding="webHttpBinding" contract="JASWebservices.IJCPSRest" behaviorConfiguration="web">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviour">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
所以,如果我访问此当地(我开发的机器上)它的工作原理。 如果我在prod服务器上远程访问它500秒。目前我唯一能看到的区别就是/ myapp /开头,因为prod服务器上有多个站点,每个站点都有自己的web应用程序。
500状态码可能是在服务器上处理请求时引发了一些异常。您是否尝试过调试服务?如果托管在IIS上,我猜虚拟目录路径不应该导致任何问题。确保远程产品服务器上的应用程序池目标框架 – Rajesh