JAXB Header security with Spring-WS
<p>im try to develop a webservices with JAXB and SpringWS.
but i have a question.
Where i put my wss Security and how i create a Header?</p>

<p>this is my actual code:</p>

<p>CONTEXT SPRING CLIENT</p>

<pre><code>    @Configuration
public class MonsterWSClientContext {

    private static final String URL = "AAA";
    private static final String TEST_URL = "TEST";
    private static final String WS_URL = TEST_URL + "/soap/WSOfferService";

    @Bean
    @Autowired
    public MonsterWSClient monsterClient(Jaxb2Marshaller marshaller) {
        MonsterWSClient client = new MonsterWSClient();
        client.setDefaultUri(WS_URL);
        client.setMarshaller(marshaller);
        client.setUnmarshaller(marshaller);
        return client;
    }


    @Bean
    public Jaxb2Marshaller marshaller() {
        Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
        jaxb2Marshaller.setPackagesToScan(com.monster.schemas.monster.ObjectFactory.class.getPackage().getName(), 
                com.monster.schemas.monsterheader.ObjectFactory.class.getPackage().getName(), 
                com.monster.schemas.ObjectFactory.class.getPackage().getName(),
                com.monster.webservices.monsterportal.ObjectFactory.class.getPackage().getName());
        return jaxb2Marshaller;

    }

}
</code></pre>

<p>this is the client</p>

<pre><code>public class MonsterWSClient extends WebServiceGatewaySupport {


    public JobsResponse updateJob(Job request) {

        return (JobsResponse) getWebServiceTemplate().marshalSendAndReceive(request,
                new SoapActionCallback(getDefaultUri() + "/createOffer"));
    }
}
</code></pre>

<p>and this is the main:</p>

<pre><code>public class Test {
     public JobsResponse callMonster(String jobRefCode, String userName,
     InformazioniAnnuncio datiAnnuncio)
     {
         MonsterWSClient client = new MonsterWSClient();
         JobsResponse response = new JobsResponse();    
         return response = client.updateJob(createJob(jobRefCode, userName, datiAnnuncio));

     }
}
</code></pre>

<ul>
<li>i have create the Job object.</li>
<li>but i dont understand where i put the header with my credential.</li>
</ul>

<p>Thanks.</p>