2010-08-23 2 views
1

안녕하세요, 여기에 내 Web.config 파일이 있습니다. Service1/help를 제외한 모든 서비스가 내 서비스에 적용됩니다.WCF 나머지 템플릿 40에 대한 도움말 없음

<system.web> 
    <compilation debug="true" targetFramework="4.0" /> 
    <customErrors mode="Off"/> 
    </system.web> 

    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"> 
     <remove name="UrlRoutingModule"/> 
     <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
    </modules> 
    <handlers> 
     <add 
     name="UrlRoutingHandler" 
     preCondition="integratedMode" 
     verb="*" path="UrlRouting.axd" 
     type="System.Web.HttpForbiddenHandler, System.Web, &#xD;&#xA;   Version=2.0.0.0, Culture=neutral, &#xD;&#xA;   PublicKeyToken=b03f5f7f11d50a3a" 
     /> 
    </handlers> 
    </system.webServer> 
    <system.serviceModel> 

    <bindings> 
     <webHttpBinding> 
     <binding name="SSLBinding"> 
      <security mode="Transport"> 
      <transport clientCredentialType="Certificate" proxyCredentialType="None" /> 
      </security> 
     </binding> 
     </webHttpBinding> 
    </bindings> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="sBehavior"> 
      <routing routeOnHeadersOnly="true" /> 
      <serviceMetadata httpsGetEnabled="true" httpsGetBinding="webHttpBinding" httpsGetBindingConfiguration="" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 



    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> 

    <standardEndpoints> 
     <webHttpEndpoint> 
     <standardEndpoint name="Default" helpEnabled="true" automaticFormatSelectionEnabled="true"> 
      <security mode="Transport"> 
      <transport clientCredentialType="Certificate"/> 
      </security>   
     </standardEndpoint> 
     </webHttpEndpoint> 
    </standardEndpoints>  

    </system.serviceModel> 

</configuration> 

서비스 :

namespace UserWebServices 
{ 
    // Start the service and browse to http://<machine_name>:<port>/Service1/help to view the service's generated help page 
    // NOTE: By default, a new instance of the service is created for each call; change the InstanceContextMode to Single if you want 
    // a single instance of the service to process all calls. 
    [ServiceContract] 
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] 
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] 
    // NOTE: If the service is renamed, remember to update the global.asax.cs file 
    public class Service1 
    { 
     // TODO: Implement the collection resource that will contain the SampleItem instances 

     [WebGet(UriTemplate = "")] 
     public List<SampleItem> GetCollection() 
     { 
      // TODO: Replace the current implementation to return a collection of SampleItem instances 
      return new List<SampleItem>() { new SampleItem() { Id = 1, StringValue = "Kader" }, 
              new SampleItem() { Id = 2, StringValue = "Weber" }}; 
     } 

     [WebGet(UriTemplate = "{id}")] 
     public SampleItem Get(string id) 
     { 
      int idConverted = Convert.ToInt32(id); 

      return new SampleItem() { Id = idConverted, StringValue = "SingleItem" };   
     } 

     [WebInvoke(UriTemplate = "", Method = "POST")]   
     public SampleItem Create(SampleItem instance) 
     { 
      if (instance == null) 
       throw new NoNullAllowedException(); 

      return instance; 
     }   

     [WebInvoke(UriTemplate = "{id}", Method = "PUT")] 
     public SampleItem Update(string id, SampleItem instance) 
     { 
      int idConverted = Convert.ToInt32(id); 

      return new SampleItem() { Id = idConverted, StringValue = "Putted" };   
     } 

     [WebInvoke(UriTemplate = "{id}", Method = "DELETE")] 
     public void Delete(string id) 
     { 
      // TODO: Remove the instance of SampleItem with the given id from the collection 
      throw new NotImplementedException(); 
     } 
    } 
} 
+0

'Service1 \ help'를 요청하면 어떻게됩니까? –

+0

에 http : // localhost를 : 35810/서비스 1/도움말 수율 : 요청 오류 는 서버가 요청을 처리하는 동안 오류가 발생했습니다. 자세한 내용은 서버 로그를 참조하십시오. –

답변

관련 문제