Author: jbonofre
Date: Thu Jul 23 09:37:01 2009
New Revision: 796986

URL: http://svn.apache.org/viewvc?rev=796986&view=rev
Log:
Correct the default WSDL.
Override the activate() endpoint method to define the endpoint 
description/definition using WSDL.

Modified:
    
servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/ExecEndpoint.java
    
servicemix/components/engines/servicemix-exec/trunk/src/main/resources/servicemix-exec.wsdl

Modified: 
servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/ExecEndpoint.java
URL: 
http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/ExecEndpoint.java?rev=796986&r1=796985&r2=796986&view=diff
==============================================================================
--- 
servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/ExecEndpoint.java
 (original)
+++ 
servicemix/components/engines/servicemix-exec/trunk/src/main/java/org/apache/servicemix/exec/ExecEndpoint.java
 Thu Jul 23 09:37:01 2009
@@ -16,7 +16,6 @@
  */
 package org.apache.servicemix.exec;
 
-import javax.jbi.management.DeploymentException;
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.InOut;
 import javax.jbi.messaging.MessageExchange;
@@ -29,6 +28,9 @@
 import org.apache.servicemix.exec.utils.ExecUtils;
 import org.apache.servicemix.exec.utils.ExecutionData;
 import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.soap.util.DomUtil;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
 
 /**
  * Represents an exec endpoint.
@@ -37,6 +39,8 @@
  * @org.apache.xbean.XBean element="endpoint"
  */
 public class ExecEndpoint extends ProviderEndpoint {
+    
+    public final static String DEFAULT_WSDL = "servicemix-exec.wsdl";
 
        private String command; // the command can be static (define in the 
descriptor) or provided in the incoming message
        private ExecMarshalerSupport marshaler = new DefaultExecMarshaler(); // 
the default exec marshaler
@@ -81,22 +85,21 @@
        
        /*
         * (non-Javadoc)
-        * @see 
org.apache.servicemix.common.endpoints.AbstractEndpoint#validate()
+        * @see 
org.apache.servicemix.common.endpoints.ProviderEndpoint#activate()
         */
        @Override
-       public void validate() throws DeploymentException {
-           // TODO validate the WSDL
-           super.validate();
-       }
-       
-       /*
-        * (non-Javadoc)
-        * @see org.apache.servicemix.common.endpoints.SimpleEndpoint#start()
-        */
-       @Override
-       public void start() throws Exception {
-           // TODO register the WSDL definition in the endpoint definition
-           // TODO register the WSDL content in the endpoint description (the 
definition document) 
+       public void activate() throws Exception {
+           // get the WSDL resource
+           Resource wsdl = new ClassPathResource(DEFAULT_WSDL);
+           
+           // parse the WSDL to populate the endpoint description
+           description = DomUtil.parse(wsdl.getInputStream());
+           // extract the WSDL definition from the description
+           definition = 
javax.wsdl.factory.WSDLFactory.newInstance().newWSDLReader().readWSDL(null, 
description);
+           
+           // TODO override WSDL attributes (binding, service name, etc) using 
the endpoint configuration
+           // (contained in the xbean.xml)
+           // it should use PortTypeDecorator.decorate()
        }
 
        /*

Modified: 
servicemix/components/engines/servicemix-exec/trunk/src/main/resources/servicemix-exec.wsdl
URL: 
http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-exec/trunk/src/main/resources/servicemix-exec.wsdl?rev=796986&r1=796985&r2=796986&view=diff
==============================================================================
--- 
servicemix/components/engines/servicemix-exec/trunk/src/main/resources/servicemix-exec.wsdl
 (original)
+++ 
servicemix/components/engines/servicemix-exec/trunk/src/main/resources/servicemix-exec.wsdl
 Thu Jul 23 09:37:01 2009
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<wsdl:definitions name="servicemix-exec"
+<definitions name="servicemix-exec"
                   
targetNamespace="http://servicemix.apache.org/servicemix-exec";
                   xmlns="http://schemas.xmlsoap.org/wsdl/";
                   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap";
@@ -40,4 +40,4 @@
         </port>
     </service>
                   
-</wsdl:definitions>                  
\ No newline at end of file
+</definitions>                  
\ No newline at end of file


Reply via email to