This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Web Services and the fly likes Web Service removing soapenv:actor attribute from header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Web Service removing soapenv:actor attribute from header" Watch "Web Service removing soapenv:actor attribute from header" New topic

Web Service removing soapenv:actor attribute from header

Ashish Kirpan

Joined: Jan 24, 2011
Posts: 22


I created the webservice client and setting some header value in it, below is sample

<RequestorCredentials xmlns="https://paysecure/merchant.soap.header/" soapenv:actor="" soapenv:mustUnderstand="0" xmlns:soapenv="">
<Token soapenv:actor="" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:xsi="" xmlns:xsd="">9EB53237-1BF4-4E35-B70B-C703D41EA74F</Token>
<Version soapenv:actor="" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:xsi="" xmlns:xsd=""></Version>
<CallerID soapenv:actor="" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:xsi="" xmlns:xsd="">720261</CallerID>
<UserCredentials soapenv:actor="" soapenv:mustUnderstand="0">
<UserID soapenv:actor="" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:xsi="" xmlns:xsd="">UBITEST</UserID>
<Password soapenv:actor="" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:xsi="" xmlns:xsd="">ubitest@123</Password>

but when I form the header request, it contains some extra attributes are appended by default

soapenv:actor="" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:xsi="" xmlns:xsd=""

I want to remove this attributes as web service rejecting my request due to these extra parameters.

Here is sample code which i used to form the header request

SOAPHeaderElement requestorCredentials = new SOAPHeaderElement(new QName("RequestorCredentials"));
requestorCredentials.setAttribute("xmlns", "https://paysecure/merchant.soap.header/");

SOAPHeaderElement eleToken = new SOAPHeaderElement(new QName("Token"));

SOAPHeaderElement eleVersion = new SOAPHeaderElement(new QName("Version"));

SOAPHeaderElement eleCallerID = new SOAPHeaderElement(new QName("CallerID"));


SOAPHeaderElement eleUserCred = new SOAPHeaderElement(new QName("UserCredentials"));

SOAPHeaderElement eleUserID = new SOAPHeaderElement(new QName("UserID"));

SOAPHeaderElement elePassword = new SOAPHeaderElement(new QName("Password"));


System.out.println("XML : "+requestorCredentials.getAsString());

If anybody has idea of such kind of situation,please help.
I agree. Here's the link:
subject: Web Service removing soapenv:actor attribute from header
jQuery in Action, 3rd edition