我在visual studio 2008上构建了一个WCF REST Web服务(在windows xp上)
当我尝试通过URL访问webservice时,它返回400错误的请求错误。
[WebGet(ResponseFormat = WebMessageFormat.Xml, UriTemplate = "hello/{Name}")]
[OperationContract]
string SayHello(string Name);
请帮忙。
的web.config
<system.serviceModel>
<services>
<service behaviorConfiguration="DNNServiceBehavior" name="DNNService">
<endpoint address="" binding="wsHttpBinding" contract="IDNNService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<endpoint address="rest" binding="webHttpBinding" behaviorConfiguration="httpBehavior" contract="IDNNService"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="DNNServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="httpBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>