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安全头在服务器端的代码。 感谢所有帮助
在此先感谢 史蒂夫