我刚开始使用WCF和Azure,但我有一个WCF Web服务,在Visual Studio中调试时可以正常工作。我将启动项目设置为Azure,对于我尝试的任何与服务相关的URL,都会收到404个错误。
以下是我认为的相关代码:
来自IWebService.cs
[OperationContract]
[WebGet(UriTemplate = "GetData/Xml?value={value}", ResponseFormat=WebMessageFormat.Xml)]
string GetDataXml(string value);
从Web.config:
<system.serviceModel>
<services>
<service name="WebService" behaviorConfiguration="WebServiceBehavior">
<endpoint address="" binding="webHttpBinding" contract="IWebService" behaviorConfiguration="WebEndpointBehavior"></endpoint>
<endpoint address="ws" binding="wsHttpBinding" contract="IWebService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WebServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="WebEndpointBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
我试过将绑定改为“basicHttpBinding”,但那没有成功。
提前感谢您的帮助!