TestComplete: Adding headers to Message bug?
Hi,
I'm trying to test my WebServices over net.tcp protocol, so I've choosen TestComplete to get it done.
I do not want to create XML files manually, so I'm using simple call to service methods. Most of them need custom header with authorization details, so I've attached to OnWebServiceRequest method, and using
WebServiceHelperObj.AddHeader(Name, Namespace, Value)
method I'm trying to get it done. Now,the problem:
After using the method mentioned above, my header does not look like it should. An example:
Calling :
Helper.AddHeader("UserID", "http://tempuri.org/", "jsmith");
Helper.AddHeader("Password", "http://tempuri.org/", "25jeL3n");
results in header:
<s:Header>
<a:Action s:mustUnderstand="1">http://tempuri.org/MethodContract/MethodName</a:Action>
<a:MessageID>urn:uuid:9244f15d-ae34-422c-ad9d-cd32f616b042</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<UserID xmlns="http://tempuri.org/">
<UserID>jsmith</UserID>
</UserID>
<Password xmlns="http://tempuri.org/">
<Password>25jeL3n</Password>
</Password>
<a:To s:mustUnderstand="1">net.tcp://ADDRESS.svc</a:To>
</s:Header>
As you can see, the header elements are nested, which is not the result I would want to achieve.
Second problem: the header i require to add is nested structure, as follows:
<s:Header>
<MyHeader>
<UserName>NAME</UserName>
<Password>Password</Password>
</MyHeader>
</s:Header>
how can I achieve this using AddHelper method?