STS サーバーに接続している WCF クライアントを持っていますが、それを制御することはできません (これはサード パーティの PHP サービスです)。
数日間の調査の後、純粋に WCF を使用して受け入れる方法でサーバーと通信することができました。もちろん、すべての SOAP 要素を無視して、いくつかの文字をネットワークに配置するのは簡単でした。しかし、最終的にはすべての構成パラメーターを正しく推測することができたので、STS サービスは私の要求に次のように応答します。
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<RequestSecurityTokenResponse xmlns="http://schemas.xmlsoap.org/ws/2005/02/trust">
<TokenType>http://schemas.xmlsoap.org/ws/2005/02/sc/sct</TokenType>
<RequestedSecurityToken>
<SecurityContextToken xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<Identifier>bipro:D5J9M0...</Identifier>
</SecurityContextToken>
</RequestedSecurityToken>
</RequestSecurityTokenResponse>
</Body>
</Envelope>
しかし、今は識別子の値を抽出するのに苦労しています。私のプロキシ クラス ( ) では、と の考えられるすべての組み合わせをすべての型SecurityTokenServicePortTypeClient : ClientBase<SecurityTokenServicePortType>, SecurityTokenServicePortType
で試しました。しかし、私が得るのは.ServiceContract
DataContract
XmlSerialization
null
サービス コントラクトの (大幅に変更された) インターフェイスは次のようになります。
[ServiceContract(Namespace = "http://schemas.xmlsoap.org/ws/2005/02/trust")]
public interface SecurityTokenServicePortType {
[OperationContract(Action = "urn:RequestSecurityToken", ReplyAction = "*")]
object RequestSecurityToken();
}
(大幅に変更された)実装クラスには、このようなメソッドがあります
object SecurityTokenServicePortType.RequestSecurityToken() {
var x = base.Channel.RequestSecurityToken();
return x;
}
x は常にnull
.
戻り値の型の代わりに、object
元はRequestSecurityTokenResponse
そうでした。
私は何年も前に WSE で同じ問題を抱えていましたが、たとえばXmlElementAttribute
逆シリアル化プロセスを制御するための適切な組み合わせを使用するだけで解決できました。しかし、今回は役に立たないようです。
アドバイスをありがとう!
ビョルン