You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by jb...@apache.org on 2010/06/07 12:18:05 UTC
svn commit: r952178 -
/servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapProviderMarshaler.java
Author: jbonofre
Date: Mon Jun 7 10:18:04 2010
New Revision: 952178
URL: http://svn.apache.org/viewvc?rev=952178&view=rev
Log:
[SMXCOMP-754] Add support of the Content-Type in the HttpSoapProviderMarshaler depending of the SOAP version.
Modified:
servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapProviderMarshaler.java
Modified: servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapProviderMarshaler.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapProviderMarshaler.java?rev=952178&r1=952177&r2=952178&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapProviderMarshaler.java (original)
+++ servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapProviderMarshaler.java Mon Jun 7 10:18:04 2010
@@ -49,6 +49,7 @@ public class HttpSoapProviderMarshaler e
private Policy[] policies;
private String baseUrl;
private Map<Phase, InterceptorChain> chains = new HashMap<Phase, InterceptorChain>();
+ private String soapVersion = "1.2";
public Binding<?> getBinding() {
return binding;
@@ -82,6 +83,14 @@ public class HttpSoapProviderMarshaler e
this.policies = policies;
}
+ public String getSoapVersion() {
+ return this.soapVersion;
+ }
+
+ public void setSoapVersion(String soapVersion) {
+ this.soapVersion = soapVersion;
+ }
+
public void createRequest(final MessageExchange exchange,
final NormalizedMessage inMsg,
final SmxHttpExchange httpExchange) throws Exception {
@@ -91,6 +100,12 @@ public class HttpSoapProviderMarshaler e
if (getAcceptEncoding() != null) {
httpExchange.setRequestHeader(HttpHeaders.ACCEPT_ENCODING, getAcceptEncoding());
}
+ // set the content type depending of the SOAP version
+ if (soapVersion.equals("1.1")) {
+ httpExchange.setRequestContentType("text/xml");
+ } else {
+ httpExchange.setRequestContentType("application/soap+xml");
+ }
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStream encodingStream = getRequestEncodingStream(getContentEncoding(), baos);
Message msg = binding.createMessage();