1つのweb.configで複数のサービスを使用しようとしています。私が抱えている問題は、https://localhost/APGame.WebHost/PlayService.svc/checktraining?g=3に行くと、リソースが見つかりません(404)というエラーが出ます。私は1つのサービスと複数のサービス契約を使用してこれを実行しようとしましたが、どちらもうまくいきませんでした。1つの設定で複数のWCFバインディングまたはサービスを設定する
https://localhost/APGame.WebHost/PlayService.svcにアクセスしてサービスが実行されています。私はちょうど私が間違っていることを確信しています。 WCFため
のWeb.config
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="json">
<webHttp defaultOutgoingResponseFormat="Json" helpEnabled="true" />
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="APGame.Services.GameManager">
<endpoint address="" binding="wsHttpBinding" contract="APGame.Contracts.IGameService" />
</service>
<service name="APGame.Services.PlayManager">
<endpoint address="" behaviorConfiguration="json" binding="webHttpBinding" contract="APGame.Contracts.IPlayService" />
</service>
</services>
<bindings>
<wsHttpBinding>
<binding transactionFlow="true" sendTimeout="00:20:00">
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
<serviceActivations>
<add service="APGame.Services.GameManager" relativeAddress="GameService.svc" />
<add service="APGame.Services.PlayManager" relativeAddress="PlayService.svc" />
</serviceActivations>
</serviceHostingEnvironment>
</system.serviceModel>
サービス契約
[ServiceContract]
public interface IPlayService
{
[OperationContract]
[WebInvoke(Method = "GET", UriTemplate = "/checktraining?g={groupGameId}")]
bool? CheckTraining(int groupGameId);
}
に
bindingConfiguration="webBinding"
を追加<bindings>
タグ内部の私のweb.configファイルに以下を追加しますSOAPUIを使用して結果を得ることができますか? –
"APGame.Contracts.IGameService"契約はありません。 – granadaCoder
@ granadaCoder私はIGameServiceの契約を結んでいます。私は新しいサービスや新しいサービス契約を作成して、Ajax w/AngularJSのRESTfulサービスとして動作させようとしています –