I want to add attributes to soap header like
<soapenv:Header attr="somevalue"attr1="somevalue"/>
Using Axis 1. But the API won't let me do this. I am getting this element inside one more header element like
<soapenv:Header>
<soapenv:Header attr="somevalue"attr1="somevalue"/>
</soapenv:Header>
Any help is appreciated.
Here is the code to add header
SOAPFactory factory = SOAPFactory.newInstance();
String prefix = "soapenv";
String uri="http://schemas.xmlsoap.org/soap/envelope/";
SOAPElement Elem;
Elem = factory.createElement("Header",prefix,uri);
Elem.addAttribute(QName.valueOf("attr"), "value");
Elem.addAttribute(QName.valueOf("attr"), "value");
SOAPHeaderElement soapheader=new SOAPHeaderElement(Elem);
stub.setHeader(soapheader);