1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.ws.soap.soap11.decoder.http;
18
19 import org.opensaml.ws.message.MessageContext;
20 import org.opensaml.ws.message.decoder.MessageDecodingException;
21 import org.opensaml.ws.soap.soap11.decoder.SOAP11Decoder;
22 import org.opensaml.ws.transport.http.HTTPInTransport;
23 import org.opensaml.xml.parse.ParserPool;
24 import org.slf4j.Logger;
25 import org.slf4j.LoggerFactory;
26
27
28
29
30 public class HTTPSOAP11Decoder extends SOAP11Decoder {
31
32
33 private final Logger log = LoggerFactory.getLogger(HTTPSOAP11Decoder.class);
34
35
36 public HTTPSOAP11Decoder() {
37 super();
38 }
39
40
41
42
43
44
45 public HTTPSOAP11Decoder(ParserPool pool) {
46 super(pool);
47 }
48
49
50 protected void doDecode(MessageContext messageContext) throws MessageDecodingException {
51
52 if (!(messageContext.getInboundMessageTransport() instanceof HTTPInTransport)) {
53 log.error("Invalid inbound message transport type, this decoder only support HTTPInTransport");
54 throw new MessageDecodingException(
55 "Invalid inbound message transport type, this decoder only support HTTPInTransport");
56 }
57
58 HTTPInTransport inTransport = (HTTPInTransport) messageContext.getInboundMessageTransport();
59 if (!inTransport.getHTTPMethod().equalsIgnoreCase("POST")) {
60 throw new MessageDecodingException("This message deocoder only supports the HTTP POST method");
61 }
62
63 super.doDecode(messageContext);
64
65 }
66
67 }