]> git.basschouten.com Git - openhab-addons.git/blob
9a42f04c63bbd6fe941a14ee9f46a0d5d6c13158
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.helios.internal.ws.soap;
14
15 import java.util.HashSet;
16 import java.util.Set;
17
18 import javax.xml.namespace.QName;
19 import javax.xml.ws.handler.MessageContext;
20 import javax.xml.ws.handler.soap.SOAPHandler;
21 import javax.xml.ws.handler.soap.SOAPMessageContext;
22
23 /**
24  * The {@link SOAPActionHandler} is a custom SOAP handler that modifies some SOAP
25  * headers in order to get the Helios comm. working
26  *
27  * @author Karel Goderis - Initial contribution
28  */
29 public class SOAPActionHandler implements SOAPHandler<SOAPMessageContext> {
30     @Override
31     public boolean handleMessage(SOAPMessageContext context) {
32         // Nothing to do here
33         return true;
34     }
35
36     @Override
37     public boolean handleFault(SOAPMessageContext context) {
38         // Nothing to do here
39         return false;
40     }
41
42     @Override
43     public void close(MessageContext context) {
44         // Nothing to do here
45     }
46
47     @Override
48     public Set<QName> getHeaders() {
49         Set<QName> set = new HashSet<>();
50         // Make sure the '[{http://www.w3.org/2005/08/addressing}]Action' header
51         // is handled in case the device set the 'MustUnderstand' attribute to
52         // '1'
53         set.add(new QName("http://www.w3.org/2005/08/addressing", "Action"));
54         return set;
55     }
56 }