0 Replies Latest reply on Jan 22, 2008 3:40 PM by vincent321

    I would like to marshall JaxB object in soapheader.

      Hi all,

      I followed the following tutorialhttp://labs.jboss.com/jbossws/user-guide/en/html/1.0.4/en/html/headers-handlers.html
      to insert information in the header.

      I tried to marshall the jaxb object with the following code :

      stub.addUnboundHeader(
       xmlName, Constants.TYPE_LITERAL_STRING,
       String.class, ParameterMode.IN
       );
      ms.marshal(createRequesterCredentials, stringWriter);
      
      String mySoapHeader = stringWriter.toString().substring("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>".length() ) ;
      
      System.out.println(mySoapHeader);
      stub.setUnboundHeaderValue(xmlName,mySoapHeader);
      


      But than the xml string inside the header of the soap enveloppe is inside a CDATA block :-(

      Do you have any clue to have the right xml data inside the header ?

      Many thanks in advance