Forum Discussion

casp8's avatar
casp8
Occasional Contributor
6 years ago
Solved

Add custom soap Header using Java API

Dear all, 

 

I want to test if our soap webservice properly declines requests with a custom header in the envelope 'soapenv:Header'.

 

I'm experiencing trouble in generating a testrequest with such a header through the JAVA packages. I hoped to get away with something like below;

String request = testStepName.getPropertyValue("Request");
request.replace( "</soapenv:Header>", "<customHeader>test</customHeader></soapenv:Header>");
testStepName.setPropertyValue("Request", request);

But at compile time the RawRequest with soapenv:Header is not availble yet. Untill now, I only made changes to the soapenv on wsa:Headers  for which there are special methods, or through changes in a WSDL.

However, for adding other custom headers I can't find any methods in the packages. 

 

So my questions is; Which methods can I user to create custom soapenv:Headers in a teststep using Java ?

 

Thanks in Advance!

Caspar