2012-12-21 2 views
3

EDIT https없이/dowork의 웹 서비스 끝점에 도달하려고해도 여전히 오류가 발생하지만 유효한 끝점을 인식합니다. HTTPS는 어떻게 활성화합니까?Azure WCF https 404 오류

저는 주로 사용자 상태에 따라 상태를 관리하기 위해 AJAX 호출을 수신하는 WCF 서비스를 보유하고 있습니다.

나는 아무것도 돌려받을 수 없다. 현재 내가 어디로 잘못 갔는지 볼 수 있니? 당신은 당신 것을 의미한다 "사이트/core.svc/dowork이에 ... 브라우저 실패"말을하는지

[ServiceContract] 
public interface Icore 
{ 
    [OperationContract] 
    [WebInvoke(UriTemplate = "/dowork", 
     BodyStyle = WebMessageBodyStyle.Wrapped, 
     ResponseFormat = WebMessageFormat.Xml)] 
    string DoWork(); 
} 

[System.Web.Script.Services.ScriptService] 
public class core : Icore 
{ 
    public string DoWork() 
    { 
     return "hullo"; 
    } 
} 

    <system.web> 
    <compilation debug="true" targetFramework="4.5"/> 
    <customErrors mode="Off"/> 
    <pages controlRenderingCompatibilityVersion="4.0"/> 
    <webServices> 
     <protocols> 
     <add name="HttpGet"/> 
     <add name="HttpPost"/> 
     </protocols> 
    </webServices> 
    </system.web> 
    <system.serviceModel> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> 
    <bindings> 
     <webHttpBinding></webHttpBinding> 
    </bindings> 
    <services> 
     <service name="Fusion.core" behaviorConfiguration="Fusion.CoreBehavior" > 
     <endpoint contract="Fusion.Icore" binding="webHttpBinding" behaviorConfiguration="webBehavior" address="" /> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="Fusion.CoreBehavior"> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
     </behavior> 
     </serviceBehaviors> 
     <endpointBehaviors> 
     <behavior name="webBehavior"> 
      <webHttp /> 
     </behavior> 
     </endpointBehaviors> 
    </behaviors> 
    </system.serviceModel> 
+0

https 끝점에 연결하고 있습니까? 에서 전송 모드 보안을 구성 했습니까? 또는 http endpoint를 사용하면 작동하는 것으로 보입니까? – Praburaj

+0

나는 그것으로 간섭하려고했지만, 나는 같은 효과를 얻는다. 나는 core.svc로 바로 갈 수있다. – Wesley

답변

0

(사이트/core.svc/dowork는 브라우저와 아약스 모두 실패) HTTP GET을 사용하여 서비스에 액세스합니다. 그러나 계약서에는 [WebInvoke]가 사용되며 HTTP POST가 가능합니다. [WebInvoke]를 [WebGet]으로 변경하고 브라우저에서 내용이 변경되는지 확인하십시오.

+0

슬프게도, 그것은 아닙니다 :(나는 당신의 메모에 동의하지 않습니다. 이것은 틀렸지 만 404 에러 이외의 다른 것을 기대할 것입니다. – Wesley

+0

사실, 저는 이것이 방법 불일치라면 404라고 확신합니다. 그게 아니라 내가 생각할 수있는 다음 것은 'security mode = "전송자"라고 Praburaj가 지적했다. (http://taciturndiscourse.com/services/ssl-for-webhttpbinding/ 참조). "간섭"에 문제가 있는지 여부를 확인할 수 있도록이 두 수정본 (WebInvoke-> WebGet 및 전송 보안)을 반영하여 실제로 질문을 편집 할 수 있습니까? –