You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2007/04/16 12:53:41 UTC

svn commit: r529200 - /incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java

Author: antelder
Date: Mon Apr 16 03:53:38 2007
New Revision: 529200

URL: http://svn.apache.org/viewvc?view=rev&rev=529200
Log:
Axis2 bidning, fiex to the service uri

Modified:
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java?view=diff&rev=529200&r1=529199&r2=529200
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java Mon Apr 16 03:53:38 2007
@@ -74,7 +74,7 @@
         compositeReference.getInterfaceContract().getInterface().setDefaultDataBinding(OMElement.class.getName());        
 
         URI targetURI = wsBinding.getURI() != null ? URI.create(wsBinding.getURI()) : URI.create("foo");
-        URI name = URI.create(context.getComponentId() + "#" + wsBinding.getName());
+        URI name = URI.create(context.getComponentId() + "#" + compositeReference.getName());
 
         return new Axis2ReferenceBinding(name, targetURI, wsBinding);
     }
@@ -87,8 +87,7 @@
         // Set to use the Axiom data binding 
         interfaceContract.getInterface().setDefaultDataBinding(OMElement.class.getName());        
 
-        URI name = URI.create(context.getComponentId() + "#" + wsBinding.getName());
-        URI uri = computeActualURI(wsBinding, BASE_URI, name, compositeService.getName()).normalize();
+        URI uri = computeActualURI(wsBinding, BASE_URI, compositeService.getName()).normalize();
 
         ServiceBinding serviceBinding = new Axis2ServiceBinding(uri, interfaceContract, null, wsBinding, servletHost, configContext, null);
 
@@ -114,7 +113,7 @@
      * over any implicitly used WSDL.
      * @param parent 
      */
-    protected URI computeActualURI(WebServiceBinding wsBinding, String baseURI, URI componentURI, String bindingName) {
+    protected URI computeActualURI(WebServiceBinding wsBinding, String baseURI, String componentName) {
         URI wsdlURI = null;         
         if (wsBinding.getServiceName() != null && wsBinding.getBindingName() == null) {
             // <binding.ws> explicitly points at a wsdl port, may be a relative URI
@@ -142,6 +141,8 @@
             }
         }
         
+        URI componentURI = URI.create(componentName);
+        
         if (componentURI == null) { // null for references
             wsdlURI = getEndpoint(wsBinding.getPort());
             if (bindingURI != null) {
@@ -155,9 +156,9 @@
         //        boolean singleService = (parent != null) && (((Component)parent.getChild(componentURI.toString())).getInboundWires().size() == 1);
         //        if (bindingURI == null && !singleService) {
 
-        if (bindingURI == null) {
-            bindingURI = URI.create(bindingName);
-        }
+//        if (bindingURI == null) {
+//            bindingURI = URI.create(bindingName);
+//        }
 
         if (componentURI.isAbsolute()) {
             if (bindingURI == null && wsdlURI == null) {
@@ -194,10 +195,12 @@
      * Returns the endpoint of a given port.
      */
     protected URI getEndpoint(Port wsdlPort) {
-        final List wsdlPortExtensions = wsdlPort.getExtensibilityElements();
-        for (final Object extension : wsdlPortExtensions) {
-            if (extension instanceof SOAPAddress) {
-                return URI.create(((SOAPAddress) extension).getLocationURI());
+        if (wsdlPort != null) {
+            final List wsdlPortExtensions = wsdlPort.getExtensibilityElements();
+            for (final Object extension : wsdlPortExtensions) {
+                if (extension instanceof SOAPAddress) {
+                    return URI.create(((SOAPAddress) extension).getLocationURI());
+                }
             }
         }
         return null;



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