001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017 package org.apache.servicemix.soap.bindings.http.impl;
018
019 import java.util.List;
020
021 import org.apache.servicemix.soap.api.Interceptor;
022 import org.apache.servicemix.soap.bindings.http.interceptors.HttpDecoderInterceptor;
023 import org.apache.servicemix.soap.bindings.http.interceptors.HttpInOperationInterceptor;
024 import org.apache.servicemix.soap.bindings.http.model.Wsdl2HttpBinding;
025 import org.apache.servicemix.soap.bindings.http.model.Wsdl2HttpOperation;
026 import org.apache.servicemix.soap.core.model.AbstractBinding;
027 import org.apache.servicemix.soap.interceptors.jbi.JbiFaultOutInterceptor;
028 import org.apache.servicemix.soap.interceptors.jbi.JbiInInterceptor;
029 import org.apache.servicemix.soap.interceptors.jbi.JbiOutInterceptor;
030 import org.apache.servicemix.soap.interceptors.mime.AttachmentsOutInterceptor;
031 import org.apache.servicemix.soap.interceptors.xml.BodyOutInterceptor;
032 import org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor;
033
034 public class Wsdl2HttpBindingImpl extends AbstractBinding<Wsdl2HttpOperation> implements Wsdl2HttpBinding {
035
036 private String httpAuthenticationRealm;
037 private AuthenticationType httpAuthenticationType;
038 private boolean httpCookies;
039 private String httpMethodDefault;
040 private String httpQueryParameterSeparatorDefault;
041 private String httpTransferCodingDefault;
042 private String httpVersion;
043
044 public Wsdl2HttpBindingImpl() {
045 List<Interceptor> phase;
046
047 // ServerIn phase
048 phase = getInterceptors(Phase.ServerIn);
049 phase.add(new HttpInOperationInterceptor());
050 phase.add(new HttpDecoderInterceptor(true));
051 phase.add(new JbiInInterceptor(true));
052
053 // ServerOut phase
054 phase = getInterceptors(Phase.ServerOut);
055 phase.add(new JbiFaultOutInterceptor());
056 phase.add(new JbiOutInterceptor(true));
057 phase.add(new AttachmentsOutInterceptor());
058 phase.add(new StaxOutInterceptor());
059 phase.add(new BodyOutInterceptor());
060
061 // ClientOut phase
062 phase = getInterceptors(Phase.ClientOut);
063
064 // ClientIn phase
065 phase = getInterceptors(Phase.ClientIn);
066 }
067
068 /**
069 * @return the httpAuthenticationRealm
070 */
071 public String getHttpAuthenticationRealm() {
072 return httpAuthenticationRealm;
073 }
074 /**
075 * @param httpAuthenticationRealm the httpAuthenticationRealm to set
076 */
077 public void setHttpAuthenticationRealm(String httpAuthenticationRealm) {
078 this.httpAuthenticationRealm = httpAuthenticationRealm;
079 }
080 /**
081 * @return the httpAuthenticationType
082 */
083 public AuthenticationType getHttpAuthenticationType() {
084 return httpAuthenticationType;
085 }
086 /**
087 * @param httpAuthenticationType the httpAuthenticationType to set
088 */
089 public void setHttpAuthenticationType(AuthenticationType httpAuthenticationType) {
090 this.httpAuthenticationType = httpAuthenticationType;
091 }
092 /**
093 * @return the httpCookies
094 */
095 public boolean isHttpCookies() {
096 return httpCookies;
097 }
098 /**
099 * @param httpCookies the httpCookies to set
100 */
101 public void setHttpCookies(boolean httpCookies) {
102 this.httpCookies = httpCookies;
103 }
104 /**
105 * @return the httpMethodDefault
106 */
107 public String getHttpMethodDefault() {
108 return httpMethodDefault;
109 }
110 /**
111 * @param httpMethodDefault the httpMethodDefault to set
112 */
113 public void setHttpMethodDefault(String httpMethodDefault) {
114 this.httpMethodDefault = httpMethodDefault;
115 }
116 /**
117 * @return the httpQueryParamterSeparatorDefault
118 */
119 public String getHttpQueryParameterSeparatorDefault() {
120 return httpQueryParameterSeparatorDefault;
121 }
122 /**
123 * @param httpQueryParamterSeparatorDefault the httpQueryParamterSeparatorDefault to set
124 */
125 public void setHttpQueryParameterSeparatorDefault(String httpQueryParamterSeparatorDefault) {
126 this.httpQueryParameterSeparatorDefault = httpQueryParamterSeparatorDefault;
127 }
128 /**
129 * @return the httpTransferCodingDefault
130 */
131 public String getHttpTransferCodingDefault() {
132 return httpTransferCodingDefault;
133 }
134 /**
135 * @param httpTransferCodingDefault the httpTransferCodingDefault to set
136 */
137 public void setHttpTransferCodingDefault(String httpTransferCodingDefault) {
138 this.httpTransferCodingDefault = httpTransferCodingDefault;
139 }
140 /**
141 * @return the httpVersion
142 */
143 public String getHttpVersion() {
144 return httpVersion;
145 }
146 /**
147 * @param httpVersion the httpVersion to set
148 */
149 public void setHttpVersion(String httpVersion) {
150 this.httpVersion = httpVersion;
151 }
152 }