• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Web Service removing soapenv:actor attribute from header

 
Greenhorn
Posts: 22
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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

<RequestorCredentials xmlns="https://paysecure/merchant.soap.header/" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<Token soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">9EB53237-1BF4-4E35-B70B-C703D41EA74F</Token>
<Version soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">1.0.0.0</Version>
<CallerID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">720261</CallerID>
<UserCredentials soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0">
<UserID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">UBITEST</UserID>
<Password soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">ubitest@123</Password>
</UserCredentials>
</RequestorCredentials>

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

soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"

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"));
eleToken.setValue(this.token);

SOAPHeaderElement eleVersion = new SOAPHeaderElement(new QName("Version"));
eleVersion.setValue(this.version);

SOAPHeaderElement eleCallerID = new SOAPHeaderElement(new QName("CallerID"));
eleCallerID.setValue(this.callerId);

requestorCredentials.addChild(eleToken);
requestorCredentials.addChild(eleVersion);
requestorCredentials.addChild(eleCallerID);

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

SOAPHeaderElement eleUserID = new SOAPHeaderElement(new QName("UserID"));
eleUserID.setValue(this.userId);

SOAPHeaderElement elePassword = new SOAPHeaderElement(new QName("Password"));
elePassword.setValue(this.password);

eleUserCred.addChild(eleUserID);
eleUserCred.addChild(elePassword);
requestorCredentials.addChild(eleUserCred);

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

((org.apache.axis.client.Stub)portType).setHeader(requestorCredentials);
---------------------------------------
If anybody has idea of such kind of situation,please help.
 
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic