Dynamically generated WSDL not generating output message for void types  
-------------------------------------------------------------------------

                 Key: TUSCANY-2042
                 URL: https://issues.apache.org/jira/browse/TUSCANY-2042
             Project: Tuscany
          Issue Type: Bug
            Reporter: Lou Amodeo


This problem is similar to Tuscany-1658 but it appears the fix is not working 
properly in all cases.  I am finding that the 
namespace and element namespace values assigned durig the dynamic wsdl 
definition generation are causing the following code to not function because 
the    if (element.getAttribute("targetNamespace").equals(namespaceURI)) { 
is returning false.   This is because the target namespace is being generated 
as : targetNamespace=http://helloworld
while the element namespace is : http://helloworld/xsd  

The method signature is :  public void getGreetings(String name)


class:  Java2WSDLHelper.java

 private static void processNoArgAndVoidReturnMethods(Definition definition, 
Class javaInterface) {
        String namespaceURI = definition.getTargetNamespace();
        String prefix = definition.getPrefix(namespaceURI);
        String xsPrefix = 
definition.getPrefix("http://www.w3.org/2001/XMLSchema";);
        PortType portType = 
(PortType)definition.getAllPortTypes().values().iterator().next();

        Element schema = null;
        Document document = null;
        Types types = definition.getTypes();
        if (types != null) {
            for (Object ext : types.getExtensibilityElements()) {
                if (ext instanceof Schema) {
                    Element element = ((Schema)ext).getElement();
                    if 
(element.getAttribute("targetNamespace").equals(namespaceURI)) {
                        schema = element;
                        document = schema.getOwnerDocument();
                        break;
                    }
                }
            }
        }
        if (document == null) {
            return;
        }


Definition generated: 

Definition: name=null targetNamespace=http://helloworld
Types:
SchemaExtensibilityElement ({http://www.w3.org/2001/XMLSchema}schema):
required=null
element=[xs:schema: null]
Message: name={http://helloworld}getGreetingsMessage
Part: name=part1
elementName={http://helloworld/xsd}getGreetings
PortType: name={http://helloworld}HelloWorldServicePortType
Operation: name=getGreetings
style=ONE_WAY,0
Input: name=null
Message: name={http://helloworld}getGreetingsMessage
Part: name=part1
elementName={http://helloworld/xsd}getGreetings
Binding: name={http://helloworld}HelloWorldServiceSOAP12Binding
PortType: name={http://helloworld}HelloWorldServicePortType
Operation: name=getGreetings
style=ONE_WAY,0
Input: name=null
Message: name={http://helloworld}getGreetingsMessage
Part: name=part1
elementName={http://helloworld/xsd}getGreetings
BindingOperation: name=getGreetings
BindingInput: name=null
SOAPBody ({http://schemas.xmlsoap.org/wsdl/soap12/}body):
required=null
use=literal
namespaceURI=http://helloworld
SOAPOperation ({http://schemas.xmlsoap.org/wsdl/soap12/}operation):
required=null
soapActionURI=urn:getGreetings
style=document
SOAPBinding ({http://schemas.xmlsoap.org/wsdl/soap12/}binding):
required=null
transportURI=http://schemas.xmlsoap.org/soap/http
style=document
Binding: name={http://helloworld}HelloWorldServiceSOAP11Binding
PortType: name={http://helloworld}HelloWorldServicePortType
Operation: name=getGreetings
style=ONE_WAY,0
Input: name=null
Message: name={http://helloworld}getGreetingsMessage
Part: name=part1
elementName={http://helloworld/xsd}getGreetings
BindingOperation: name=getGreetings
BindingInput: name=null
SOAPBody ({http://schemas.xmlsoap.org/wsdl/soap/}body):
required=null
use=literal
namespaceURI=http://helloworld
SOAPOperation ({http://schemas.xmlsoap.org/wsdl/soap/}operation):
required=null
soapActionURI=urn:getGreetings
style=document
SOAPBinding ({http://schemas.xmlsoap.org/wsdl/soap/}binding):
required=null
transportURI=http://schemas.xmlsoap.org/soap/http
style=document
Service: name={http://helloworld}HelloWorldService
Port: name=HelloWorldServiceSOAP11port
Binding: name={http://helloworld}HelloWorldServiceSOAP11Binding
PortType: name={http://helloworld}HelloWorldServicePortType
Operation: name=getGreetings
style=ONE_WAY,0
Input: name=null
Message: name={http://helloworld}getGreetingsMessage
Part: name=part1
elementName={http://helloworld/xsd}getGreetings
BindingOperation: name=getGreetings
BindingInput: name=null
SOAPBody ({http://schemas.xmlsoap.org/wsdl/soap/}body):
required=null
use=literal
namespaceURI=http://helloworld
SOAPOperation ({http://schemas.xmlsoap.org/wsdl/soap/}operation):
required=null
soapActionURI=urn:getGreetings
style=document
SOAPBinding ({http://schemas.xmlsoap.org/wsdl/soap/}binding):
required=null
transportURI=http://schemas.xmlsoap.org/soap/http
style=document
SOAPAddress ({http://schemas.xmlsoap.org/wsdl/soap/}address):
required=null
locationURI=http://localhost:8080/axis2/services/HelloWorldService
Port: name=HelloWorldServiceSOAP12port
Binding: name={http://helloworld}HelloWorldServiceSOAP12Binding
PortType: name={http://helloworld}HelloWorldServicePortType
Operation: name=getGreetings
style=ONE_WAY,0
Input: name=null
Message: name={http://helloworld}getGreetingsMessage
Part: name=part1
elementName={http://helloworld/xsd}getGreetings
BindingOperation: name=getGreetings
BindingInput: name=null
SOAPBody ({http://schemas.xmlsoap.org/wsdl/soap12/}body):
required=null
use=literal
namespaceURI=http://helloworld
SOAPOperation ({http://schemas.xmlsoap.org/wsdl/soap12/}operation):
required=null
soapActionURI=urn:getGreetings
style=document
SOAPBinding ({http://schemas.xmlsoap.org/wsdl/soap12/}binding):
required=null
transportURI=http://schemas.xmlsoap.org/soap/http
style=document
SOAPAddress ({http://schemas.xmlsoap.org/wsdl/soap12/}address):
required=null
locationURI=http://localhost:8080/axis2/services/HelloWorldService
 

I have attached a jar containing the  testcase. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to