これで十分です。に行くとsite/core.svc/dowork
400エラーが発生します。
結果は.ajax呼び出しでも同じです。どこで私は間違えましたか?
このウェブにアクセスできるようにしようとしています。ブラウザのイベントに基づいて状態管理を処理するメソッドを追加します。
[ServiceContract]
public interface Icore
{
[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Xml)]
string DoWork();
}
[System.Web.Script.Services.ScriptService]
public class core : Icore
{
public string DoWork()
{
return "hello";
}
}
<behaviors>
<endpointBehaviors>
<behavior name="RestBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="MetadataBehavior">
<serviceMetadata httpsGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<!-- Note: the service name must match the configuration name for the service implementation. -->
<service name="Fusion.core" behaviorConfiguration="MetadataBehavior" >
<!-- Add the following endpoint. -->
<!-- Note: your service must have an http base address to add this endpoint. -->
<endpoint contract="Fusion.Icore" binding="wsHttpBinding" bindingConfiguration="HttpsBinding" address="" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="secureBinding">
<security mode="Transport"/>
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="HttpsBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</wsHttpBinding>
</bindings>