I am getting the following error while trying to connect to a .Net web service
SoapFault - faultcode: 'q0:Security' faultstring: 'Security requirements are not satisfied because the security header is not
present in the incoming message.'
Here is the code on server side that creates the security header
public override XmlElement GetXml(XmlDocument document) {
if (null == document) throw new ArgumentException("document");
I am getting the following error while trying to connect to a .Net web service
SoapFault - faultcode: 'q0:Security' faultstring: 'Security requirements are not satisfied because the security header is not
present in the incoming message.'
Here is the code on server side that creates the security header
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;
}
Can some one tell me how I can create a security header for ksoap2 based on the above code.
Appreciate any help
Thanks in advance
Steve