01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.binding.soap;
19:
20: import org.apache.cxf.binding.BindingConfiguration;
21: import org.apache.cxf.service.model.BindingOperationInfo;
22: import org.apache.cxf.service.model.MessagePartInfo;
23: import org.apache.cxf.service.model.OperationInfo;
24:
25: public class SoapBindingConfiguration extends BindingConfiguration {
26: private SoapVersion soapVersion = Soap11.getInstance();
27: private String style = "document";
28: private String use;
29: private String transportURI = "http://schemas.xmlsoap.org/soap/http";
30: private String defaultSoapAction = "";
31: private boolean mtomEnabled;
32:
33: @Override
34: public String getBindingId() {
35: return "http://schemas.xmlsoap.org/soap/";
36: }
37:
38: protected boolean isHeader(BindingOperationInfo op,
39: MessagePartInfo part) {
40: Object isHeader = part.getProperty("messagepart.isheader");
41: return Boolean.TRUE.equals(isHeader);
42: }
43:
44: public String getSoapAction(OperationInfo op) {
45: String action = (String) op.getProperty("action");
46: if (action == null) {
47: return defaultSoapAction;
48: } else {
49: return action;
50: }
51: }
52:
53: public String getTransportURI() {
54: return transportURI;
55: }
56:
57: public void setTransportURI(String transportURI) {
58: this .transportURI = transportURI;
59: }
60:
61: protected String getStyle() {
62: return style;
63: }
64:
65: protected String getStyle(OperationInfo op) {
66: return getStyle();
67: }
68:
69: public SoapVersion getVersion() {
70: return soapVersion;
71: }
72:
73: public void setVersion(SoapVersion sv) {
74: this .soapVersion = sv;
75: }
76:
77: public String getUse() {
78: return use;
79: }
80:
81: public void setUse(String use) {
82: this .use = use;
83: }
84:
85: public void setStyle(String style) {
86: this .style = style;
87: }
88:
89: public boolean isMtomEnabled() {
90: return mtomEnabled;
91: }
92:
93: public void setMtomEnabled(boolean mtomEnabled) {
94: this.mtomEnabled = mtomEnabled;
95: }
96:
97: }
|