0
我正在嘗試連接到一個.NET Web服務Security頭錯誤ksoap2
的SOAPFault以下錯誤 - Fault代碼:「Q0:安全」 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安全頭在服務器端的代碼。 感謝所有幫助
在此先感謝 史蒂夫