Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
sigla-ws/src/main/java/it/cnr/contab/handler/MustUnderstandSOAPMessageHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package it.cnr.contab.handler; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
import javax.xml.namespace.QName; | ||
import javax.xml.ws.handler.MessageContext; | ||
import javax.xml.ws.handler.soap.SOAPHandler; | ||
import javax.xml.ws.handler.soap.SOAPMessageContext; | ||
|
||
public class MustUnderstandSOAPMessageHandler implements SOAPHandler<SOAPMessageContext> { | ||
@Override | ||
public Set<QName> getHeaders() { | ||
final QName securityHeader = new QName( | ||
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", | ||
"Security", | ||
"wsse"); | ||
|
||
final HashSet<QName> headers = new HashSet<QName>(); | ||
headers.add(securityHeader); | ||
|
||
// notify the runtime that this is handled | ||
return headers; | ||
} | ||
|
||
@Override | ||
public boolean handleMessage(SOAPMessageContext context) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean handleFault(SOAPMessageContext context) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void close(MessageContext context) { | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
sigla-ws/src/main/resources/it/cnr/contab/handler/handlers.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"> | ||
<handler-chain> | ||
<handler> | ||
<handler-name>Must Understand SOAP Message</handler-name> | ||
<handler-class>it.cnr.contab.handler.MustUnderstandSOAPMessageHandler</handler-class> | ||
</handler> | ||
</handler-chain> | ||
</handler-chains> |