Simon Laws wrote:


On Tue, Feb 10, 2009 at 3:04 PM, Simon Nash <[email protected] <mailto:[email protected]>> wrote:

    Simon Laws wrote:

           So it affects the namespace of the
           binding definition, but it shouldn't affect the namespace of the
           global elements used by message parts within the portType
           referenced by the binding (i.e., what goes on the wire).
           In this example the portType is "ns0:HelloWorld" which refers to
           global elements in the correct namespace "http:/helloworld"

           So this looks to me like an Axis bug with namespaces for imported
           portTypes not being handled correctly.  It seems the binding's
           namespace is being used to register these operations instead of
           the correct namespace as specified in the portType.

           Where in Axis is this registration happening?  Which version
           of Axis is being used?  With this information I could dig around
           a bit in the Axis code.


        How, with this generated target namespace, do we intend that the
        binding operation name is matched with the port type operation name?

        Simon

     >
    The binding references the port type:

     <wsdl:binding name="HelloWorldBinding" type="ns0:HelloWorld">

    The "ns0:" in this QName provides the cross-namespace linkage.

    You've got me wondering now whether the operation names in
    the binding will match those in the portType if the binding
    and portType come from different namespaces.  The operation
    names are NCNames so I would expect them to match.  I'll take
    a look at the WSDL spec and try to confirm this.

     Simon

Ok, so that's what I overlooked. The names in question in the WSDL are not QNames.

In the class org.apache.axis2.description.AxisOperation.getName() returns a QName. With this insight I'll look again and see if I'm interpreting what I see correctly.

There is a line in org.apache.axis2.description.AxisOperation.AxisDescription

AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisBinding
                                    .getChild(axisOperation.getName());

That returns null in my particular scenario.

I'm on Axis2 1.4.1

Simon
>

In line 1282 of WSDL11ToAxisServiceBuilder, there is the following line:
  QName opName = new QName(dif.getTargetNamespace(), wsdl4jOperation.getName());
This uses the namespace of the portType definition to name the
operation children of the portType.

In line 641 of WSDL11ToAxisServiceBuilder, there is the following line:
  axisBindingOperation.setName(new QName(bindingWSDL.getTargetNamespace(), 
wsdl4jBindingOperation.getName()));
This uses the namespace of the binding definition to name the binding
operation children of the binding.  Each binding operation object has
a reference to its corresponding operation object.

The code you mentioned (at line 556 of AxisDescription) is incompatible
with the above scheme, because it uses an operation name to make a direct
lookup of a binding operation child of the binding.  It needs to be
changed to iterate through all the binding operation children of the
binding, comparing the operation name belonging to each binding operation
object against the operation name it is looking for.  When it finds a
match, it should select the binding operation that gave the match.

  Simon


Reply via email to