2 Replies Latest reply on Jan 4, 2006 12:06 PM by Karl-Christian Pammer

    Adding custom headers to SOAP message

    Karl-Christian Pammer Newbie

      Hello,

      I have got the following problem: I call a webservice provided by an external partner. The service requires authentication via UsernameToken in the header (as desribed in "OASIS Webservice Security UsernameToken Profile"). Plus some additional headers with extra information.

      I found a posting in the forum conderning that UsernameTokenProfile willbe supported in JBossWS 1.0. I am using JB 4.0.2, so I suppose I do not have release 1.0 of the webservice stack. Is there any possibilty to find out which version of the webservice stack is included in JB4.0.2?

      Our partner send my codesample how to add custom headers to the SOAP message. What they do, it that they create a DOM of the elements to add. They cast the stub of the webservice to org.apache.axis.client.Stub and use the setHeader-Method to add the DOM.
      When I cats to Stub to the corresponding class in the JBoss implementantion of Axis: org.jboss.axis.client.Stub a ClassCastException is thrown.

      Additionally the signatures of the setHeader-Method in the two classes differ:
      org.apache.axis.client.Stub: SetHeader(String, String, Object)
      org.jboss.axis.client.Stub: SetHeader(String, String,String)

      In org.apache.axis.client.Stub another setHeader-Method exists which has an SOAPHeaderElement as parameter. The corresponding method in org.jboss.axis.client.Stub needs a SOAPHeaderElementAxisImpl as parameter. Although the constructor of SOAPHeaderElementAxisImpl is mentoined as public in the javadoc I got the error message: "Contrcutor not visible", when I try to compile.

      Has anybody an idea how to add the header to the message?

      Best regards
      Charly