| Commit in servicemix/components/jaxws on MAIN | |||
| project.xml | +22 | -9 | 1.2 -> 1.3 |
| .classpath | +11 | -24 | 1.3 -> 1.4 |
| src/main/java/org/servicemix/components/jaxws/JAXWSBinding.java | +36 | -10 | 1.4 -> 1.5 |
| +69 | -43 | ||
Updated to latest greatest RI code to try get the test cases working - unfortunately not :(
servicemix/components/jaxws
diff -u -r1.2 -r1.3 --- project.xml 22 Sep 2005 11:59:19 -0000 1.2 +++ project.xml 22 Sep 2005 16:23:01 -0000 1.3 @@ -69,7 +69,7 @@
<dependency>
<groupId>servicemix</groupId>
<artifactId>jsr181-api</artifactId>
- <version>20050818</version>
+ <version>20050915</version>
</dependency>
<dependency>
<groupId>servicemix</groupId>
@@ -78,24 +78,37 @@
</dependency>
<dependency>
<groupId>servicemix</groupId>
- <artifactId>jaxws-rt</artifactId> - <version>dev-1</version> - </dependency> - <dependency> - <groupId>servicemix</groupId>
<artifactId>jaxb-api</artifactId>
- <version>20050818</version>
+ <version>20050915</version>
</dependency>
<dependency>
<groupId>servicemix</groupId>
<artifactId>jaxb-impl</artifactId>
- <version>20050818</version>
+ <version>20050915</version>
</dependency>
<dependency>
<groupId>servicemix</groupId>
<artifactId>jaxb-xjc</artifactId>
- <version>20050818</version>
+ <version>20050915</version>
+ </dependency>
+ <dependency>
+ <groupId>servicemix</groupId>
+ <artifactId>saaj-api</artifactId>
+ <version>20050915</version>
+ </dependency>
+ <dependency>
+ <groupId>servicemix</groupId>
+ <artifactId>saaj-impl</artifactId>
+ <version>20050915</version>
+ </dependency>
+
+ <!-- jstrachan patch from CVS HEAD -->
+ <dependency>
+ <groupId>servicemix</groupId>
+ <artifactId>jaxws-rt</artifactId>
+ <version>dev-1</version>
</dependency>
+
<!-- Sun's StAX implementation -->
<dependency>
servicemix/components/jaxws
diff -u -r1.3 -r1.4 --- .classpath 22 Sep 2005 11:59:19 -0000 1.3 +++ .classpath 22 Sep 2005 16:23:01 -0000 1.4 @@ -1,44 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?> <classpath>
- <classpathentry kind="lib" path="/jaxws-ri/build/lib/sjsxp.jar"/> - <classpathentry kind="lib" path="/jaxws-ri/build/lib/jsr173_api.jar"/> - <classpathentry kind="lib" path="/jaxws-ri/build/lib/saaj-impl.jar"/> - <classpathentry kind="lib" path="/jaxws-ri/build/lib/saaj-api.jar"/> - <classpathentry kind="lib" path="/jaxws-ri/build/lib/resolver.jar"/> - <classpathentry kind="lib" path="/jaxws-ri/build/lib/jsr250-api.jar"/> - <classpathentry kind="lib" path="/jaxws-ri/build/lib/jsr181-api.jar"/> - <classpathentry kind="lib" path="/jaxws-ri/build/lib/jaxws-tools.jar"/>
+ <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/sjsxp-20050915.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/saaj-impl-20050915.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/saaj-api-20050915.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/jsr181-api-20050915.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/jaxws-rt-dev-1.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/jaxws-api-20050915.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/jaxb-xjc-20050915.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/jaxb-impl-20050915.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/spring-1.2.2-dev-2.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/servicemix-1.1-SNAPSHOT.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/jaxb-api-20050915.jar"/>
<classpathentry sourcepath="/jaxws-ri/rt/src" kind="lib" path="/jaxws-ri/build/lib/jaxws-rt.jar"/>
- <classpathentry kind="lib" path="/jaxws-ri/build/lib/jaxws-api.jar"/> - <classpathentry kind="lib" path="/jaxws-ri/build/lib/jaxb-xjc.jar"/> - <classpathentry kind="lib" path="/jaxws-ri/build/lib/jaxb-impl.jar"/> - <classpathentry kind="lib" path="/jaxws-ri/build/lib/jaxb-api.jar"/> - <classpathentry kind="lib" path="/jaxws-ri/build/lib/http.jar"/> - <classpathentry kind="lib" path="/jaxws-ri/build/lib/FastInfoset.jar"/> - <classpathentry kind="lib" path="/jaxws-ri/build/lib/activation.jar"/>
<classpathentry kind="src" path="src/main/java"/> <classpathentry kind="src" path="src/test/resources"/> <classpathentry kind="src" path="src/test/java"/> <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/spring-1.2.2-dev-2.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/activemq/jars/activemq-3.1.jar"/> <classpathentry kind="var" path="MAVEN_REPO/geronimo-spec/jars/geronimo-spec-j2ee-1.4-rc4.jar"/> <classpathentry kind="var" path="MAVEN_REPO/mx4j/jars/mx4j-jmx-2.1.1.jar"/>
- <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/jsr181-api-20050818.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/jaxws-api-20050818.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/jaxb-api-20050818.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/jaxb-impl-20050818.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/jaxb-xjc-20050818.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/jencks/jars/jencks-all-1.0-M1.jar"/> <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.3.jar"/> <classpathentry kind="var" path="MAVEN_REPO/concurrent/jars/concurrent-1.3.4.jar"/>
- <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/jaxws-rt-dev-1.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/jaxws-api-20050915.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/jetty/jars/jasper-runtime-4.2.20RC0.jar"/> <classpathentry kind="var" path="MAVEN_REPO/jetty/jars/jasper-compiler-4.2.20RC0.jar"/> <classpathentry kind="var" path="MAVEN_REPO/jetty/jars/org.mortbay.jetty-4.2.20RC0.jar"/> <classpathentry kind="var" path="MAVEN_REPO/stax/jars/stax-api-1.0.jar"/>
- <classpathentry kind="var" path="MAVEN_REPO/servicemix/jars/servicemix-1.1-SNAPSHOT.jar"/>
<classpathentry kind="output" path="bin"/> </classpath>
servicemix/components/jaxws/src/main/java/org/servicemix/components/jaxws
diff -u -r1.4 -r1.5 --- JAXWSBinding.java 22 Sep 2005 11:59:19 -0000 1.4 +++ JAXWSBinding.java 22 Sep 2005 16:23:01 -0000 1.5 @@ -17,9 +17,12 @@
**/ package org.servicemix.components.jaxws;
+import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory;
import org.servicemix.MessageExchangeListener; import org.servicemix.components.util.TransformComponentSupport; import org.springframework.core.io.Resource;
+import org.w3c.dom.Node;
import javax.jbi.JBIException; import javax.jbi.messaging.InOnly;
@@ -29,6 +32,7 @@
import javax.jbi.messaging.NormalizedMessage; import javax.xml.namespace.QName; import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
import javax.xml.ws.Dispatch; import javax.xml.ws.Service; import javax.xml.ws.WebServiceException;
@@ -41,13 +45,16 @@
/** * Converts an inbound JBI message into a <a
- * href="">JAX-WS</a> one way or a request-response where the output is - * replied back to the Normalized Message Router.
+ * href="">JAX-WS</a> one way or a + * request-response where the output is replied back to the Normalized Message + * Router.
*
- * @version $Revision$
+ * @version $Revision$
*/
public class JAXWSBinding extends TransformComponentSupport implements MessageExchangeListener {
+ private static final Log log = LogFactory.getLog(JAXWSBinding.class); +
private Dispatch<Source> dispatch;
private Service jaxService;
private URL wsdl;
@@ -142,16 +149,31 @@
}
}
- protected boolean transform(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out)
- throws MessagingException {
+ protected boolean transform(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws MessagingException {
Source content = getInMessage(exchange).getContent();
try {
if (isInOutRequest(exchange, in, out)) {
copyPropertiesAndAttachments(exchange, in, out);
- Source answer = dispatch.invoke(content); - out.setContent(answer);
+ Object answer = dispatch.invoke(content);
+ System.out.println("##### received a response: " + answer);
+ log.info("received a response: " + answer);
+
+ Source source = null;
+ if (answer instanceof Source) {
+ source = (Source) answer;
+ }
+ else if (answer instanceof Node) {
+ source = new DOMSource((Node) source);
+ }
+ else if (answer instanceof Throwable) {
+ throw new MessagingException((Throwable) answer);
+ }
+ else {
+ throw new MessagingException("Unknown source type: " + source);
+ }
+ out.setContent(source);
}
else {
dispatch.invokeOneWay(content);
@@ -160,6 +182,9 @@
catch (WebServiceException e) {
throw new MessagingException(e);
}
+ catch (Throwable t) {
+ throw new MessagingException(t);
+ }
return true;
}
@@ -178,8 +203,9 @@
interfaceName = findInterfaceName(webService);
}
/*
- webService.addPort(interfaceName, getPortBindingId(), getEndpointAddress()); - */
+ * webService.addPort(interfaceName, getPortBindingId(), + * getEndpointAddress()); + */
return webService.createDispatch(interfaceName, Source.class, getMode());
}
@@ -201,7 +227,7 @@
return Service.create(serviceName);
}
}
-
+
protected URL createWsdl() throws IOException {
if (wsdlResource != null) {
return wsdlResource.getURL();
