none
host 在IIS里的多端点问题, RRS feed

  • 问题

  • 配置文件如下, <system.serviceModel> <services> <service behaviorConfiguration="CRR.Services.Ecommerce_OrderService_Behavior" name="CRR.Services.Ecommerce_OrderService"> <endpoint address="" binding="basicHttpBinding" name="Ecommerce_OrderServiceEndPoint" bindingNamespace="urn:CompanyName.ProjectName" contract="CRR.Services.IEcommerce_OrderService" /> <endpoint address="abcd" binding="wsHttpBinding" name="Ecommerce_OrderServiceEndPoint" bindingNamespace="urn:CompanyName.ProjectName" contract="CRR.Services.IEcommerce_OrderService" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="CRR.Services.Ecommerce_OrderService_Behavior"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> 我在客户端通过add service reference 添加下面的URL是可以的 http://localhost/CRR.Host/CustomServices/Ecommerce/Ecommerce_OrderService.svc 但是下面的却不行, http://localhost/CRR.Host/CustomServices/Ecommerce/Ecommerce_OrderService.svc/abcd 报如下的错误: "There was an error downloading 'http://localhost/CRR.Host/CustomServices/Ecommerce/Ecommerce_OrderService.svc/abcd'. The request failed with HTTP status 400: Bad Request. Metadata contains a reference that cannot be resolved: 'http://localhost/CRR.Host/CustomServices/Ecommerce/Ecommerce_OrderService.svc/abcd'. Metadata contains a reference that cannot be resolved: 'http://localhost/CRR.Host/CustomServices/Ecommerce/Ecommerce_OrderService.svc/abcd'. If the service is defined in the current solution, try building the solution and adding the service reference again." 请问如何解决?
    2011年7月13日 4:30

答案

全部回复