asp.net mvc プロジェクトを開始すると、error.Internal Server Error が発生します。IIS Express で asp.net mvc と wcf アプリケーションをホストしています。
<services>
<service name="WCFSkyAuction.Service.UserRoleService">
<endpoint address="" behaviorConfiguration="WCFSkyAuction.Service.UserRoleServiceAspNetAjaxBehavior"
binding="webHttpBinding" name="UserService" contract="WCFSkyAuction.Service.UserRoleService" />
</service>
<service name="WCFSkyAuction.Service.AdminRoleService">
<endpoint address="" behaviorConfiguration="WCFSkyAuction.Service.AdminRoleServiceAspNetAjaxBehavior"
binding="webHttpBinding" name="AdminService" contract="WCFSkyAuction.Service.AdminRoleService" />
</service>
<service name="WCFSkyAuction.Service.VipRoleService">
<endpoint address="" behaviorConfiguration="WCFSkyAuction.Service.VipRoleServiceAspNetAjaxBehavior"
binding="webHttpBinding" contract="WCFSkyAuction.Service.VipRoleService"/>
</service>
<service name="WCFSkyAuction.Service.MailService">
<endpoint address="" behaviorConfiguration="WCFSkyAuction.Service.MailServiceAspNetAjaxBehavior"
binding="webHttpBinding" contract="WCFSkyAuction.Service.MailService" />
</service>
</services>
<endpointBehaviors>
<behavior name="WCFSkyAuction.Service.UserRoleServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
<behavior name="WCFSkyAuction.Service.AdminRoleServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
<behavior name="WCFSkyAuction.Service.VipRoleServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
<behavior name="WCFSkyAuction.Service.MailServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
これは、WCF 側の私の構成ファイルです。各エンドポイントには webHttp バインディングがあり、4 つの svc ファイルにコントラクトがあります。
<system.serviceModel>
<client>
<endpoint address="http://localhost:8080/WCFSkyAuction/Service/UserRoleService.svc"
binding="webHttpBinding" bindingConfiguration="" behaviorConfiguration="webhttp" contract="UserService.UserRoleService"
name="UserService" />
<endpoint address="http://localhost:8080/WCFSkyAuction/Service/AdminRoleService.svc"
binding="webHttpBinding" behaviorConfiguration="webhttp" contract="AdminService.AdminRoleService"
name="AdminService" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="webhttp">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
これは、asp.net mvc 側の web.config です。WCF ファイルを編集して、クライアント エンドポイントと動作を記述しました。サービス参照の追加が適切に機能し、すべての参照を追加しました。サービスの最初の操作でプロジェクトを開始したときに、Internal Server Error.Communication Exception was unhandled by user code が発生しました。ありがとう、どうやって決めるの?