You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2008/06/26 17:31:01 UTC
svn commit: r671922 - in
/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src:
main/java/org/apache/servicemix/http/endpoints/
test/java/org/apache/servicemix/http/
Author: gnodet
Date: Thu Jun 26 08:31:00 2008
New Revision: 671922
URL: http://svn.apache.org/viewvc?rev=671922&view=rev
Log:
SM-1427: Soap marshalers can not be overriden
Modified:
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpConsumerEndpoint.java
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpProviderEndpoint.java
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapConsumerEndpoint.java
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapProviderEndpoint.java
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java
Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpConsumerEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpConsumerEndpoint.java?rev=671922&r1=671921&r2=671922&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpConsumerEndpoint.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpConsumerEndpoint.java Thu Jun 26 08:31:00 2008
@@ -69,7 +69,7 @@
private String authMethod;
private SslParameters ssl;
private String locationURI;
- private HttpConsumerMarshaler marshaler = new DefaultHttpConsumerMarshaler();
+ private HttpConsumerMarshaler marshaler;
private long timeout; // 0 => default to the timeout configured on component
private URI defaultMep = MessageExchangeSupport.IN_OUT;
@@ -394,6 +394,9 @@
public void validate() throws DeploymentException {
super.validate();
+ if (marshaler == null) {
+ marshaler = new DefaultHttpConsumerMarshaler();
+ }
if (marshaler instanceof DefaultHttpConsumerMarshaler) {
((DefaultHttpConsumerMarshaler) marshaler).setDefaultMep(getDefaultMep());
}
Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpProviderEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpProviderEndpoint.java?rev=671922&r1=671921&r2=671922&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpProviderEndpoint.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpProviderEndpoint.java Thu Jun 26 08:31:00 2008
@@ -18,6 +18,7 @@
import java.io.IOException;
+import javax.jbi.management.DeploymentException;
import javax.jbi.messaging.ExchangeStatus;
import javax.jbi.messaging.MessageExchange;
import javax.jbi.messaging.NormalizedMessage;
@@ -65,15 +66,6 @@
this.locationURI = locationURI;
}
- public void start() throws Exception {
- if (marshaler == null) {
- DefaultHttpProviderMarshaler m = new DefaultHttpProviderMarshaler();
- m.setLocationURI(locationURI);
- marshaler = m;
- }
- super.start();
- }
-
/*
public BasicAuthCredentials getBasicAuthentication() {
return basicAuthentication;
@@ -152,4 +144,14 @@
}
}
+ public void validate() throws DeploymentException {
+ super.validate();
+ if (marshaler == null) {
+ marshaler = new DefaultHttpProviderMarshaler();
+ }
+ if (marshaler instanceof DefaultHttpProviderMarshaler && locationURI != null) {
+ ((DefaultHttpProviderMarshaler) marshaler).setLocationURI(locationURI);
+ }
+ }
+
}
Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapConsumerEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapConsumerEndpoint.java?rev=671922&r1=671921&r2=671922&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapConsumerEndpoint.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapConsumerEndpoint.java Thu Jun 26 08:31:00 2008
@@ -107,7 +107,14 @@
if (wsdl == null) {
throw new DeploymentException("wsdl property must be set");
}
- HttpSoapConsumerMarshaler marshaler = new HttpSoapConsumerMarshaler();
+ HttpSoapConsumerMarshaler marshaler;
+ if (getMarshaler() instanceof HttpSoapConsumerMarshaler) {
+ marshaler = (HttpSoapConsumerMarshaler) getMarshaler();
+ } else if (getMarshaler() == null) {
+ marshaler = new HttpSoapConsumerMarshaler();
+ } else {
+ throw new DeploymentException("The configured marshaler must inherit HttpSoapConsumerMarshaler");
+ }
try {
description = DomUtil.parse(wsdl.getInputStream());
Element elem = description.getDocumentElement();
Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapProviderEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapProviderEndpoint.java?rev=671922&r1=671921&r2=671922&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapProviderEndpoint.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/endpoints/HttpSoapProviderEndpoint.java Thu Jun 26 08:31:00 2008
@@ -108,7 +108,14 @@
if (wsdl == null) {
throw new DeploymentException("wsdl property must be set");
}
- HttpSoapProviderMarshaler marshaler = new HttpSoapProviderMarshaler();
+ HttpSoapProviderMarshaler marshaler;
+ if (getMarshaler() instanceof HttpSoapProviderMarshaler) {
+ marshaler = (HttpSoapProviderMarshaler) getMarshaler();
+ } else if (getMarshaler() == null) {
+ marshaler = new HttpSoapProviderMarshaler();
+ } else {
+ throw new DeploymentException("The configured marshaler must inherit HttpSoapProviderMarshaler");
+ }
try {
description = DomUtil.parse(wsdl.getInputStream());
Element elem = description.getDocumentElement();
Modified: servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java?rev=671922&r1=671921&r2=671922&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java Thu Jun 26 08:31:00 2008
@@ -16,8 +16,8 @@
*/
package org.apache.servicemix.http;
-import javax.jbi.messaging.InOut;
import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOut;
import javax.xml.namespace.QName;
import junit.framework.TestCase;