You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jb...@apache.org on 2006/08/11 08:22:41 UTC

svn commit: r430692 - /incubator/tuscany/java/sca/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLLoader.java

Author: jboynes
Date: Thu Aug 10 23:22:41 2006
New Revision: 430692

URL: http://svn.apache.org/viewvc?rev=430692&view=rev
Log:
cosmetic - rearrange stax processing to top

Modified:
    incubator/tuscany/java/sca/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLLoader.java

Modified: incubator/tuscany/java/sca/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLLoader.java?rev=430692&r1=430691&r2=430692&view=diff
==============================================================================
--- incubator/tuscany/java/sca/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLLoader.java (original)
+++ incubator/tuscany/java/sca/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLLoader.java Thu Aug 10 23:22:41 2006
@@ -33,6 +33,7 @@
 import org.apache.tuscany.spi.loader.LoaderException;
 import org.apache.tuscany.spi.loader.LoaderUtil;
 import org.apache.tuscany.spi.loader.LoaderRegistry;
+import org.apache.tuscany.spi.loader.InvalidValueException;
 import org.apache.tuscany.spi.services.wsdl.WSDLDefinitionRegistry;
 
 /**
@@ -63,35 +64,37 @@
                                     DeploymentContext deploymentContext)
         throws XMLStreamException, LoaderException {
         assert INTERFACE_WSDL.equals(reader.getName());
-        WSDLServiceContract serviceContract = new WSDLServiceContract();
+
+        String interfaceURI = reader.getAttributeValue(null, "interface");
+        if (interfaceURI == null) {
+            throw new InvalidValueException("interface");
+        }
+
+        String callbackURI = reader.getAttributeValue(null, "callbackInterface");
+        String wsdlLocation = reader.getAttributeValue(WSDLI, WSDLI_LOCATION);
         // FIXME set the interaction scope
 //        serviceContract.setInteractionScope(StAXUtil.interactionScope(reader.getAttributeValue(null, "scope")));
+        LoaderUtil.skipToEndElement(reader);
 
-        String location = reader.getAttributeValue(WSDLI, WSDLI_LOCATION);
-        if (location != null) {
+        if (wsdlLocation != null) {
             try {
-                wsdlRegistry.loadDefinition(location, deploymentContext.getClassLoader());
+                wsdlRegistry.loadDefinition(wsdlLocation, deploymentContext.getClassLoader());
             } catch (IOException e) {
                 LoaderException le = new LoaderException(e);
-                le.setIdentifier(location);
+                le.setIdentifier(wsdlLocation);
                 throw le;
             } catch (WSDLException e) {
                 LoaderException le = new LoaderException(e);
-                le.setIdentifier(location);
+                le.setIdentifier(wsdlLocation);
                 throw le;
             }
         }
 
-        String portTypeURI = reader.getAttributeValue(null, "interface");
-        if (portTypeURI != null) {
-            serviceContract.setPortType(getPortType(portTypeURI));
-        }
-
-        portTypeURI = reader.getAttributeValue(null, "callbackInterface");
-        if (portTypeURI != null) {
-            serviceContract.setCallbackPortType(getPortType(portTypeURI));
+        WSDLServiceContract serviceContract = new WSDLServiceContract();
+        serviceContract.setPortType(getPortType(interfaceURI));
+        if (callbackURI != null) {
+            serviceContract.setCallbackPortType(getPortType(callbackURI));
         }
-        LoaderUtil.skipToEndElement(reader);
         return serviceContract;
     }
 



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