.Net Web サービスに接続しようとすると、次のエラーが発生します。
SoapFault - faultcode: 'q0:Security' faultstring: '受信メッセージにセキュリティ ヘッダーが存在しないため、セキュリティ要件が満たされていません。
セキュリティヘッダーを作成するサーバー側のコードは次のとおりです
public override XmlElement GetXml(XmlDocument document) {
if (null == document) throw new ArgumentException("document");
XmlElement root = document.CreateElement("abc", "TokenName", "http://testurl.com");
if (!string.IsNullOrEmpty(Id)) {
root.SetAttribute(WSUtility.Prefix, WSUtility.NamespaceURI);
root.SetAttribute(WSUtility.AttributeNames.Id, WSUtility.NamespaceURI, Id);
}
XmlElement machineIdElement = document.CreateElement("abc", "machineId", "http://testurl.com");
machineIdElement.InnerText = "060a5270-7ae7-11e2-b92a-0800200c9a66";
root.AppendChild(machineIdElement);
XmlElement inspectorIdElement = document.CreateElement("dac", "insId", "http://testurl.com");
inspectorIdElement.InnerText = "dc0a5270-7ae7-11e2-b92a-0800200c9a66";
root.AppendChild(inspectorIdElement);
return root;
}
上記のコードに基づいて ksoap2 のセキュリティ ヘッダーを作成する方法を教えてください。どんな助けにも感謝します
前もって感謝します スティーブ