[jira] Commented: (TUSCANY-2042) Dynamically generated WSDL not generating output message for void types
[ https://issues.apache.org/jira/browse/TUSCANY-2042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12567848#action_12567848 ] Scott Kurz commented on TUSCANY-2042: - It is looking more like an Axis2 versioning issue for me. In 1.3, Axis2 J2W seems to switch from generating: * wsdl def TNS=xxx * schema TNS for wrapper elems = xxx/xsd like it did in Axis2 1.2, to simply: * wsdl def TNS=xxx * schema TNS for wrapper elems = xxx which looks to be my issue. 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 Fix For: Java-SCA-Next Attachments: helloworld-ws-asynch.jar 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 theif (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:
[jira] Commented: (TUSCANY-2042) Dynamically generated WSDL not generating output message for void types
[ https://issues.apache.org/jira/browse/TUSCANY-2042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12567709#action_12567709 ] Scott Kurz commented on TUSCANY-2042: - I recreated this at the same time as stepping through the debugger. I saw a problem here: (not sure if it's the same as you 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 Attachments: helloworld-ws-asynch.jar 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 theif (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