Author: mmerz Date: Thu Dec 23 15:53:43 2004 New Revision: 123255 URL: http://svn.apache.org/viewcvs?view=rev&rev=123255 Log: Fixed WSDL to OM processing for methods that are the Oneway or return Void.
Added more methods to the AddressBook sample. Contributor: Daryoush Mehrtash Modified: incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/client-build.xml incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/src/web/Service.jws incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java Modified: incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/client-build.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/client-build.xml?view=diff&rev=123255&p1=incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/client-build.xml&r1=123254&p2=incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/client-build.xml&r2=123255 ============================================================================== --- incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/client-build.xml (original) +++ incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/client-build.xml Thu Dec 23 15:53:43 2004 @@ -3,7 +3,7 @@ <project name="AddressBookClient" basedir="." default="all"> <property name="AddressBook.wsdl.url" - value="http://localhost:8080/AddressBookWS/web/Service.jws?wsdl" /> + value="http://localhost:8080/AddressBook/web/Service.jws?wsdl" /> <path id="jars"> @@ -20,12 +20,15 @@ <target name="clean"> <delete dir="build" /> + <delete dir="./logs" /> + </target> <target name="dirs"> <mkdir dir="build" /> <mkdir dir="build/generated" /> <mkdir dir="build/classes" /> + <mkdir dir="./logs" /> </target> <target name="all" depends="genClient, compile, test"/> @@ -53,9 +56,8 @@ <pathelement location= "build/classes"/> <path refid="jars"/> </classpath> - - - <batchtest fork="yes" todir="."> + <formatter type="plain"/> + <batchtest fork="yes" todir="./logs"> <fileset dir="build/classes"> <include name="**/*Test*.class"/> </fileset> Modified: incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/src/web/Service.jws Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/src/web/Service.jws?view=diff&rev=123255&p1=incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/src/web/Service.jws&r1=123254&p2=incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/src/web/Service.jws&r2=123255 ============================================================================== --- incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/src/web/Service.jws (original) +++ incubator/beehive/trunk/samples/AddressBookWS/WEB-INF/src/web/Service.jws Thu Dec 23 15:53:43 2004 @@ -61,6 +61,36 @@ return addressBook.getAddressFromName(name); } + @WebMethod + public Address[] getAddressFromNames(String[] name) { + if(null == name) return null; + Address[] result = new Address[name.length]; + for(int i=0; i< name.length; i++) { + result[i] = addressBook.getAddressFromName(name[i]); + } + return result; + } + + @WebMethod + @Oneway + public void oneWayWithParam(String param1) { + return; + } + + + @WebMethod + @Oneway + public void oneWayWithNoParam() { + return; + } + + + + @WebMethod + public String simpleNoParamMethod () { + return "No Param method"; + } + /** * This method is not exposed by the Web Service and can only be used * locally. @@ -69,4 +99,6 @@ public String notWebService() { return "Not available through Web service"; } + + } Modified: incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java?view=diff&rev=123255&p1=incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java&r1=123254&p2=incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java&r2=123255 ============================================================================== --- incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java (original) +++ incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/wsdl/WSDL2AnnotatedJavaTest.java Thu Dec 23 15:53:43 2004 @@ -77,52 +77,61 @@ public void testSrcCodeGeneration() throws Exception { StringWriter result = new StringWriter(); - //FileInputStream fis = new FileInputStream("./wsm/drt/tests/FooWSDL.xml"); - //StringBufferInputStream sbis = new StringBufferInputStream(theWSDL); + //FileInputStream src = new FileInputStream("temp.wsdl"); + StringBufferInputStream src = new StringBufferInputStream(theWSDL); + WSDLProcessor wsdlProc = new XmlBeanWSDLProcessor(); + Jsr181TypeMetadata om = wsdlProc.createObjectModel(src); - Jsr181TypeMetadata om = new Jsr181TypeMetadataImpl("myClassName"); - om.setWsName("MyWebService"); - om.setWsTargetNamespace("http://beehive.apache.org/mywebservice"); - om.setWsWsdlLocation("myWsdlLocation"); + Collection<Jsr181MethodMetadata> methods =om.getMethods(); + System.out.println("Size of my mehtod list: " + om.getMethods().size()); + for(Jsr181MethodMetadata method : methods) { + System.out.println("NEXT METHOD NAME: " + method.getJavaMethodName()); + + } - Jsr181MethodMetadata method1 = new Jsr181MethodMetadataImpl("firstMethod", void.class); - method1.setOneWay(true); - method1.setWmOperationName("myFirstMethodOperationName"); - om.addMethod(method1); - - - Jsr181MethodMetadata method2 = new Jsr181MethodMetadataImpl("secondMethod", String.class); - method2.setOneWay(false); - method2.setWmOperationName("mySecondMethodOperationName"); - Jsr181ParameterMetadata param1 = new Jsr181ParameterMetadataImpl(); - param1.setJavaType(String.class); - param1.setWpName("myStringParam"); - param1.setWpTargetNamespace("http://beehive.apache.org/myparameters"); - param1.setWpMode(WebParam.Mode.INOUT); - method2.addParam(param1); - method2.setWrName("method2Result"); - method2.setWrTargetNamespace("http://beehive.apache.org//myresults"); - om.addMethod(method2); - - Jsr181MethodMetadata method3 = new Jsr181MethodMetadataImpl("thirdMethod", String.class); - method3.setOneWay(false); - method3.setWmOperationName("myThirdMethodOperationName"); - Jsr181ParameterMetadata param3_1 = new Jsr181ParameterMetadataImpl(); - param3_1.setJavaType(String.class); - param3_1.setWpName("myStringParam1"); - param3_1.setWpTargetNamespace("http://beehive.apache.org//myparameters"); - param3_1.setWpMode(WebParam.Mode.INOUT); - method3.addParam(param3_1); - Jsr181ParameterMetadata param3_2 = new Jsr181ParameterMetadataImpl(); - param3_2.setJavaType(String.class); - param3_2.setWpName("myStringParam2"); - param3_2.setWpTargetNamespace("http://beehive.apache.org//myparameters"); - param3_2.setWpMode(WebParam.Mode.IN); - method3.addParam(param3_2); - method3.setWrName("method3Result"); - method3.setWrTargetNamespace("http://beehive.apache.org//myresults"); - om.addMethod(method3); - +// Jsr181TypeMetadata om = new Jsr181TypeMetadataImpl("myClassName"); +// om.setWsName("MyWebService"); +// om.setWsTargetNamespace("http://beehive.apache.org/mywebservice"); +// om.setWsWsdlLocation("myWsdlLocation"); +// +// Jsr181MethodMetadata method1 = new Jsr181MethodMetadataImpl("firstMethod", void.class); +// method1.setOneWay(true); +// method1.setWmOperationName("myFirstMethodOperationName"); +// om.addMethod(method1); +// +// +// Jsr181MethodMetadata method2 = new Jsr181MethodMetadataImpl("secondMethod", String.class); +// method2.setOneWay(false); +// method2.setWmOperationName("mySecondMethodOperationName"); +// Jsr181ParameterMetadata param1 = new Jsr181ParameterMetadataImpl(); +// param1.setJavaType(String.class); +// param1.setWpName("myStringParam"); +// param1.setWpTargetNamespace("http://beehive.apache.org/myparameters"); +// param1.setWpMode(WebParam.Mode.INOUT); +// method2.addParam(param1); +// method2.setWrName("method2Result"); +// method2.setWrTargetNamespace("http://beehive.apache.org//myresults"); +// om.addMethod(method2); +// +// Jsr181MethodMetadata method3 = new Jsr181MethodMetadataImpl("thirdMethod", String.class); +// method3.setOneWay(false); +// method3.setWmOperationName("myThirdMethodOperationName"); +// Jsr181ParameterMetadata param3_1 = new Jsr181ParameterMetadataImpl(); +// param3_1.setJavaType(String.class); +// param3_1.setWpName("myStringParam1"); +// param3_1.setWpTargetNamespace("http://beehive.apache.org//myparameters"); +// param3_1.setWpMode(WebParam.Mode.INOUT); +// method3.addParam(param3_1); +// Jsr181ParameterMetadata param3_2 = new Jsr181ParameterMetadataImpl(); +// param3_2.setJavaType(String.class); +// param3_2.setWpName("myStringParam2"); +// param3_2.setWpTargetNamespace("http://beehive.apache.org//myparameters"); +// param3_2.setWpMode(WebParam.Mode.IN); +// method3.addParam(param3_2); +// method3.setWrName("method3Result"); +// method3.setWrTargetNamespace("http://beehive.apache.org//myresults"); +// om.addMethod(method3); +// Wsdl2AJava processor = new Wsdl2AJava(); processor.init(); @@ -132,57 +141,203 @@ } String theWSDL = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + - "<wsdl:definitions targetNamespace=\"http://www.superflaco.com/AnnotationTest\" xmlns:apachesoap=\"http://xml.apache.org/xml-soap\" xmlns:impl=\"http://www.superflaco.com/AnnotationTest\" xmlns:intf=\"http://www.superflaco.com/AnnotationTest\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:wsdlsoap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" + - " <!--WSDL created by Apache Axis version: 1.2beta3" + - " Built on Aug 15, 2004 (04:32:00 PDT)-->" + - " <wsdl:message name=\"goHomeResponse\">" + - " <wsdl:part name=\"howdy\" type=\"soapenc:string\"/>" + - " </wsdl:message>" + - " <wsdl:message name=\"goHomeRequest\">" + - " </wsdl:message>" + - " <wsdl:message name=\"GoLocoResponse\">" + - " <wsdl:part name=\"result\" type=\"xsd:boolean\"/>" + - " </wsdl:message>" + - " <wsdl:message name=\"GoLocoRequest\">" + - " <wsdl:part name=\"in0\" type=\"xsd:int\"/>" + - "<wsdl:part name=\"detail\" type=\"soapenc:string\"/>" + - " </wsdl:message>" + - " <wsdl:portType name=\"Abacus\">" + - " <wsdl:operation name=\"GoLoco\" parameterOrder=\"in0 detail\">" + - " <wsdl:input message=\"impl:GoLocoRequest\" name=\"GoLocoRequest\"/>" + - " <wsdl:output message=\"impl:GoLocoResponse\" name=\"GoLocoResponse\"/>" + - " </wsdl:operation>" + - " <wsdl:operation name=\"goHome\">" + - " <wsdl:input message=\"impl:goHomeRequest\" name=\"goHomeRequest\"/>" + - " <wsdl:output message=\"impl:goHomeResponse\" name=\"goHomeResponse\"/>" + - " </wsdl:operation>" + - " </wsdl:portType>" + - " <wsdl:binding name=\"FooSoapBinding\" type=\"impl:Abacus\">" + - " <wsdlsoap:binding style=\"rpc\" transport=\"http://schemas.xmlsoap.org/soap/http\"/>" + - " <wsdl:operation name=\"GoLoco\">" + - " <wsdlsoap:operation soapAction=\"LocoAction\"/>" + - " <wsdl:input name=\"GoLocoRequest\">" + - " <wsdlsoap:body encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" namespace=\"http://www.superflaco.com/AnnotationTest\" use=\"encoded\"/>" + - " </wsdl:input>" + - " <wsdl:output name=\"GoLocoResponse\">" + - " <wsdlsoap:body encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" namespace=\"http://www.superflaco.com/AnnotationTest\" use=\"encoded\"/>" + - " </wsdl:output>" + - " </wsdl:operation>" + - " <wsdl:operation name=\"goHome\">" + - " <wsdlsoap:operation soapAction=\"\"/>" + - " <wsdl:input name=\"goHomeRequest\">" + - " <wsdlsoap:body encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" namespace=\"http://www.superflaco.com/AnnotationTest\" use=\"encoded\"/>" + - " </wsdl:input>" + - " <wsdl:output name=\"goHomeResponse\">" + - " <wsdlsoap:body encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" namespace=\"http://www.superflaco.com/AnnotationTest\" use=\"encoded\"/>" + - " </wsdl:output>" + - " </wsdl:operation>" + - " </wsdl:binding>" + - " <wsdl:service name=\"Cheetorama\">" + - " <wsdl:port binding=\"impl:FooSoapBinding\" name=\"Foo\">" + - " <wsdlsoap:address location=\"http://localhost:8080/AnnotatedAxis/Foo.jws\"/>" + - " </wsdl:port>" + - " </wsdl:service>" + - "</wsdl:definitions>"; + "<wsdl:definitions targetNamespace=\"http://beehive.apache.org/AddressBook\" xmlns:apachesoap=\"http://xml.apache.org/xml-soap\" xmlns:impl=\"http://beehive.apache.org/AddressBook\" xmlns:intf=\"http://beehive.apache.org/AddressBook\" xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:wsdlsoap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" + + "<!--WSDL created by Apache Axis version: 1.2RC2Built on Nov 16, 2004 (12:19:44 EST)-->" + + "<wsdl:types>" + + "<schema elementFormDefault=\"qualified\" targetNamespace=\"http://beehive.apache.org/AddressBook\" xmlns=\"http://www.w3.org/2001/XMLSchema\">" + + "<element name=\"oneWayWithParam\">" + + "<complexType>" + + "<sequence>" + + "<element name=\"in0\" type=\"xsd:string\"/>" + + "</sequence>" + + "</complexType>" + + "</element>" + + "<element name=\"getAddressFromName\">" + + "<complexType>" + + "<sequence>" + + "<element name=\"in0\" type=\"xsd:string\"/>" + + "</sequence>" + + "</complexType>" + + "</element>" + + "<element name=\"getAddressFromNameResponse\">" + + "<complexType>" + + "<sequence>" + + "<element name=\"result\" type=\"impl:Address\"/>" + + "</sequence>" + + "</complexType>" + + "</element>" + + "<complexType name=\"Phone\">" + + "<sequence>" + + "<element name=\"areaCode\" type=\"xsd:int\"/>" + + "<element name=\"exchange\" nillable=\"true\" type=\"xsd:string\"/>" + + "<element name=\"number\" nillable=\"true\" type=\"xsd:string\"/>" + + "</sequence>" + + "</complexType>" + + "<complexType name=\"StateType\">" + + "<sequence>" + + "<element name=\"state\" nillable=\"true\" type=\"xsd:string\"/>" + + "</sequence>" + + "</complexType>" + + "<complexType name=\"Address\">" + + "<sequence>" + + "<element name=\"city\" nillable=\"true\" type=\"xsd:string\"/>" + + "<element name=\"phoneNumber\" nillable=\"true\" type=\"impl:Phone\"/>" + + "<element name=\"state\" nillable=\"true\" type=\"impl:StateType\"/>" + + "<element name=\"streetName\" nillable=\"true\" type=\"xsd:string\"/>" + + "<element name=\"streetNum\" type=\"xsd:int\"/>" + + "<element name=\"zip\" type=\"xsd:int\"/>" + + "</sequence>" + + "</complexType>" + + "<element name=\"oneWayWithNoParameter\">" + + "<complexType/>" + + "</element>" + + "<element name=\"addEntry\">" + + "<complexType>" + + "<sequence>" + + "<element name=\"in0\" type=\"xsd:string\"/>" + + "<element name=\"in1\" type=\"impl:Address\"/>" + + "</sequence>" + + "</complexType>" + + "</element>" + + "<element name=\"addEntryResponse\">" + + "<complexType/>" + + "</element>" + + "<element name=\"getAddressFromNames\">" + + "<complexType>" + + "<sequence>" + + "<element maxOccurs=\"unbounded\" name=\"in0\" type=\"xsd:string\"/>" + + "</sequence>" + + "</complexType>" + + "</element>" + + "<element name=\"getAddressFromNamesResponse\">" + + "<complexType>" + + "<sequence>" + + "<element maxOccurs=\"unbounded\" name=\"result\" type=\"impl:Address\"/>" + + "</sequence>" + + "</complexType>" + + "</element>" + + "<element name=\"simpleNoParamMethod\">" + + "<complexType/>" + + "</element>" + + "<element name=\"simpleNoParamMethodResponse\">" + + "<complexType>" + + "<sequence>" + + "<element name=\"result\" type=\"xsd:string\"/>" + + "</sequence>" + + "</complexType>" + + "</element>" + + "</schema>" + + "</wsdl:types>" + + "<wsdl:message name=\"getAddressFromNamesResponse\">" + + "<wsdl:part element=\"impl:getAddressFromNamesResponse\" name=\"parameters\"/>" + + "</wsdl:message>" + + "<wsdl:message name=\"addEntryRequest\">" + + "<wsdl:part element=\"impl:addEntry\" name=\"parameters\"/>" + + "</wsdl:message>" + + "<wsdl:message name=\"simpleNoParamMethodResponse\">" + + "<wsdl:part element=\"impl:simpleNoParamMethodResponse\" name=\"parameters\"/>" + + "</wsdl:message>" + + "<wsdl:message name=\"getAddressFromNamesRequest\">" + + "<wsdl:part element=\"impl:getAddressFromNames\" name=\"parameters\"/>" + + "</wsdl:message>" + + "<wsdl:message name=\"addEntryResponse\">" + + "<wsdl:part element=\"impl:addEntryResponse\" name=\"parameters\"/>" + + "</wsdl:message>" + + "<wsdl:message name=\"oneWayWithNoParameterRequest\">" + + "<wsdl:part element=\"impl:oneWayWithNoParameter\" name=\"parameters\"/>" + + "</wsdl:message>" + + "<wsdl:message name=\"getAddressFromNameResponse\">" + + "<wsdl:part element=\"impl:getAddressFromNameResponse\" name=\"parameters\"/>" + + "</wsdl:message>" + + "<wsdl:message name=\"oneWayWithParamRequest\">" + + "<wsdl:part element=\"impl:oneWayWithParam\" name=\"parameters\"/>" + + "</wsdl:message>" + + "<wsdl:message name=\"getAddressFromNameRequest\">" + + "<wsdl:part element=\"impl:getAddressFromName\" name=\"parameters\"/>" + + "</wsdl:message>" + + "<wsdl:message name=\"simpleNoParamMethodRequest\">" + + "<wsdl:part element=\"impl:simpleNoParamMethod\" name=\"parameters\"/>" + + "</wsdl:message>" + + "<wsdl:portType name=\"Service\">" + + "<wsdl:operation name=\"oneWayWithParam\">" + + "<wsdl:input message=\"impl:oneWayWithParamRequest\" name=\"oneWayWithParamRequest\"/>" + + "</wsdl:operation>" + + "<wsdl:operation name=\"getAddressFromName\">" + + "<wsdl:input message=\"impl:getAddressFromNameRequest\" name=\"getAddressFromNameRequest\"/>" + + "<wsdl:output message=\"impl:getAddressFromNameResponse\" name=\"getAddressFromNameResponse\"/>" + + "</wsdl:operation>" + + "<wsdl:operation name=\"oneWayWithNoParameter\">" + + "<wsdl:input message=\"impl:oneWayWithNoParameterRequest\" name=\"oneWayWithNoParameterRequest\"/>" + + "</wsdl:operation>" + + "<wsdl:operation name=\"addEntry\">" + + "<wsdl:input message=\"impl:addEntryRequest\" name=\"addEntryRequest\"/>" + + "<wsdl:output message=\"impl:addEntryResponse\" name=\"addEntryResponse\"/>" + + "</wsdl:operation>" + + "<wsdl:operation name=\"getAddressFromNames\">" + + "<wsdl:input message=\"impl:getAddressFromNamesRequest\" name=\"getAddressFromNamesRequest\"/>" + + "<wsdl:output message=\"impl:getAddressFromNamesResponse\" name=\"getAddressFromNamesResponse\"/>" + + "</wsdl:operation>" + + "<wsdl:operation name=\"simpleNoParamMethod\">" + + "<wsdl:input message=\"impl:simpleNoParamMethodRequest\" name=\"simpleNoParamMethodRequest\"/>" + + "<wsdl:output message=\"impl:simpleNoParamMethodResponse\" name=\"simpleNoParamMethodResponse\"/>" + + "</wsdl:operation>" + + "</wsdl:portType>" + + "<wsdl:binding name=\"ServiceSoapBinding\" type=\"impl:Service\">" + + "<wsdlsoap:binding style=\"document\" transport=\"http://schemas.xmlsoap.org/soap/http\"/>" + + "<wsdl:operation name=\"oneWayWithParam\">" + + "<wsdlsoap:operation soapAction=\"\"/>" + + "<wsdl:input name=\"oneWayWithParamRequest\">" + + "<wsdlsoap:body use=\"literal\"/>" + + "</wsdl:input>" + + "</wsdl:operation>" + + "<wsdl:operation name=\"getAddressFromName\">" + + "<wsdlsoap:operation soapAction=\"\"/>" + + "<wsdl:input name=\"getAddressFromNameRequest\">" + + "<wsdlsoap:body use=\"literal\"/>" + + "</wsdl:input>" + + "<wsdl:output name=\"getAddressFromNameResponse\">" + + "<wsdlsoap:body use=\"literal\"/>" + + "</wsdl:output>" + + "</wsdl:operation>" + + "<wsdl:operation name=\"oneWayWithNoParameter\">" + + "<wsdlsoap:operation soapAction=\"\"/>" + + "<wsdl:input name=\"oneWayWithNoParameterRequest\">" + + "<wsdlsoap:body use=\"literal\"/>" + + "</wsdl:input>" + + "</wsdl:operation>" + + "<wsdl:operation name=\"addEntry\">" + + "<wsdlsoap:operation soapAction=\"\"/>" + + "<wsdl:input name=\"addEntryRequest\">" + + "<wsdlsoap:body use=\"literal\"/>" + + "</wsdl:input>" + + "<wsdl:output name=\"addEntryResponse\">" + + "<wsdlsoap:body use=\"literal\"/>" + + "</wsdl:output>" + + "</wsdl:operation>" + + "<wsdl:operation name=\"getAddressFromNames\">" + + "<wsdlsoap:operation soapAction=\"\"/>" + + "<wsdl:input name=\"getAddressFromNamesRequest\">" + + "<wsdlsoap:body use=\"literal\"/>" + + "</wsdl:input>" + + "<wsdl:output name=\"getAddressFromNamesResponse\">" + + "<wsdlsoap:body use=\"literal\"/>" + + "</wsdl:output>" + + "</wsdl:operation>" + + "<wsdl:operation name=\"simpleNoParamMethod\">" + + "<wsdlsoap:operation soapAction=\"\"/>" + + "<wsdl:input name=\"simpleNoParamMethodRequest\">" + + "<wsdlsoap:body use=\"literal\"/>" + + "</wsdl:input>" + + "<wsdl:output name=\"simpleNoParamMethodResponse\">" + + "<wsdlsoap:body use=\"literal\"/>" + + "</wsdl:output>" + + "</wsdl:operation>" + + "</wsdl:binding>" + + "<wsdl:service name=\"ServiceService\">" + + "<wsdl:port binding=\"impl:ServiceSoapBinding\" name=\"Service\">" + + "<wsdlsoap:address location=\"http://localhost:8080/AddressBook/web/Service.jws\"/>" + + "</wsdl:port>" + + "</wsdl:service>" + + "</wsdl:definitions>"; } Modified: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java?view=diff&rev=123255&p1=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java&r1=123254&p2=incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java&r2=123255 ============================================================================== --- incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java (original) +++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/jsr181/wsdl/XmlBeanWSDLProcessor.java Thu Dec 23 15:53:43 2004 @@ -212,21 +212,40 @@ Map<String, TPart[]> messageMap, TTypes types) throws Exception { String opName = op.getName(); - TParam outputParam = op.getOutput(); - - ClientParameterMetadata[] paraMeta = + TParam outputParam = op.getOutput(); + + ClientParameterMetadata[] paraMeta = processParameters(outputParam, types, messageMap, wsm); - if (paraMeta != null && paraMeta.length == 1) { - ClientMethodMetadata wmm = + Class returnType; + QName returnXMLType; + + if(paraMeta == null) { + // Should not happen, may be need to send runtime exception, or + // define a new type of exception! + throw new Exception("Can't resolve the return type"); + } else if (paraMeta.length == 0 ) { // no return type + returnType=Void.TYPE; + returnXMLType = null; // correct? + } else if (paraMeta.length == 1 ) { + returnType = paraMeta[0].getJavaType(); + returnXMLType = paraMeta[0].getXmlType(); + } else { + // Should not happen, may be need to send runtime exception, or + // define a new type of exception! + throw new Exception("Return type is resolved into multiple parameters!"); + + } + + ClientMethodMetadata wmm = new ClientMethodMetadataImpl(opName, - paraMeta[0].getJavaType(), - paraMeta[0].getXmlType()); + returnType, + returnXMLType); wmm.setWmOperationName(opName); // FIXME [EMAIL PROTECTED] 2004-Nov-10 -- // do something better with the action wmm.setWmAction(opName); - if (Void.TYPE.equals(paraMeta[0].getJavaType())) { + if (Void.TYPE.equals(returnType)) { // FIXME [EMAIL PROTECTED] 2004-Nov-22 -- // check for faults before setting as oneway. wmm.setOneWay(true); @@ -277,9 +296,9 @@ for (Jsr181ParameterMetadata wpm : params) { System.out.println(wpm.getWpName() + ':' + wpm.getJavaType()); } - */ + */ wsm.addMethod(wmm); - } + } private ClientParameterMetadata[]
