tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r528784 - in /incubator/tuscany/java/sca/modules/binding-ws-xml: pom.xml src/main/java/org/apache/tuscany/binding/ws/xml/WebServiceBindingProcessor.java
Date Sat, 14 Apr 2007 08:42:47 GMT
Author: antelder
Date: Sat Apr 14 01:42:46 2007
New Revision: 528784

URL: http://svn.apache.org/viewvc?view=rev&rev=528784
Log:
Update binding-ws-xml resolve method to populate the WSDLDefinintion

Modified:
    incubator/tuscany/java/sca/modules/binding-ws-xml/pom.xml
    incubator/tuscany/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/binding/ws/xml/WebServiceBindingProcessor.java

Modified: incubator/tuscany/java/sca/modules/binding-ws-xml/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-xml/pom.xml?view=diff&rev=528784&r1=528783&r2=528784
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-xml/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-xml/pom.xml Sat Apr 14 01:42:46 2007
@@ -46,5 +46,10 @@
             <artifactId>tuscany-binding-ws</artifactId>
             <version>1.0-incubating-SNAPSHOT</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-interface-wsdl</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
+        </dependency>
     </dependencies>
 </project>

Modified: incubator/tuscany/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/binding/ws/xml/WebServiceBindingProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/binding/ws/xml/WebServiceBindingProcessor.java?view=diff&rev=528784&r1=528783&r2=528784
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/binding/ws/xml/WebServiceBindingProcessor.java
(original)
+++ incubator/tuscany/java/sca/modules/binding-ws-xml/src/main/java/org/apache/tuscany/binding/ws/xml/WebServiceBindingProcessor.java
Sat Apr 14 01:42:46 2007
@@ -21,6 +21,8 @@
 
 import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
 
+import javax.wsdl.Definition;
+import javax.wsdl.Service;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
@@ -36,6 +38,8 @@
 import org.apache.tuscany.contribution.service.ContributionWriteException;
 import org.apache.tuscany.contribution.service.processor.StAXArtifactProcessor;
 import org.apache.tuscany.contribution.service.resolver.ArtifactResolver;
+import org.apache.tuscany.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.interfacedef.wsdl.impl.DefaultWSDLFactory;
 
 public class WebServiceBindingProcessor implements StAXArtifactProcessor<WebServiceBinding>,
WebServiceConstants {
 
@@ -179,7 +183,24 @@
     }
     
     public void resolve(WebServiceBinding model, ArtifactResolver resolver) throws ContributionResolveException
{
-        // TODO Auto-generated method stub
+        WSDLDefinition wsdlDefinition = new DefaultWSDLFactory().createWSDLDefinition();
+        wsdlDefinition.setUnresolved(true);
+        wsdlDefinition.setNamespace(model.getServiceName().getNamespaceURI());
+        wsdlDefinition = resolver.resolve(WSDLDefinition.class, wsdlDefinition);
+        if (!wsdlDefinition.isUnresolved()) {
+            model.setDefinition(wsdlDefinition);
+            Definition definition = wsdlDefinition.getDefinition();
+            if (model.getBindingName() != null) {
+                model.setBinding(definition.getBinding(model.getBindingName()));
+            }
+            if (model.getServiceName() != null) {
+                Service service = definition.getService(model.getServiceName());
+                model.setService(service);
+                if (service != null && model.getPortName() != null) {
+                    model.setPort(service.getPort(model.getPortName()));
+                }
+            }
+        }
     }
     
     public void wire(WebServiceBinding model) throws ContributionWireException {



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message