0
私はクライアントapp.configに次のものを持っています。実行時にコントラクトネームスペースを設定するにはどうすればよいですか?
<client>
<endpoint address=""
binding="basicHttpBinding" bindingConfiguration="SecureBinding"
contract="Project.Services.Contract.IMyContract" name="Endpoint_Default">
<identity>
<servicePrincipalName value="host/mikev-ws" />
</identity>
</endpoint>
</client>
実行時にエンドポイントを設定する次のコードがあります。
private EndpointAddress GetEndpoint(string serverAddress, string serviceName)
{
string endpointURL = string.Format("http://{0}/Services/{1}.svc"
, serverAddress, serviceName);
EndpointIdentity spn = EndpointIdentity.CreateSpnIdentity("host/mikev-ws");
Uri uri = new Uri(endpointURL);
EndpointAddress endpoint = new EndpointAddress(uri, spn);
return endpoint;
}
実行時に契約値を設定するにはどうすればよいですか?
はあなたがEndpointAddress
との契約を関連付けない