Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 72071 invoked from network); 16 Apr 2007 10:58:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Apr 2007 10:58:12 -0000 Received: (qmail 41456 invoked by uid 500); 16 Apr 2007 10:58:18 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 41410 invoked by uid 500); 16 Apr 2007 10:58:17 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 41397 invoked by uid 99); 16 Apr 2007 10:58:17 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Apr 2007 03:58:17 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Apr 2007 03:58:10 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 4AE3B1A9838; Mon, 16 Apr 2007 03:57:49 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r529203 - in /incubator/cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/j... Date: Mon, 16 Apr 2007 10:57:48 -0000 To: cxf-commits@incubator.apache.org From: ema@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070416105749.4AE3B1A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ema Date: Mon Apr 16 03:57:38 2007 New Revision: 529203 URL: http://svn.apache.org/viewvc?view=rev&rev=529203 Log: Fixed issue CXF-518: corrected the element Qname referenced by a document bare message part Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?view=diff&rev=529203&r1=529202&r2=529203 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java Mon Apr 16 03:57:38 2007 @@ -182,6 +182,10 @@ String tns = mi.getName().getNamespaceURI(); QName ret = null; if (param != null) { + /*if (param.targetNamespace().length() > 0) { + tns = param.targetNamespace(); + }*/ + String local = param.partName(); if (local.length() == 0) { local = param.name(); @@ -250,7 +254,7 @@ } @Override - public QName getOutParameterName(OperationInfo op, Method method, int paramNumber) { + public QName getOutParameterName(OperationInfo op, Method method, int paramNumber) { method = getDeclaredMethod(method); if (paramNumber >= 0) { @@ -474,7 +478,7 @@ return webResult != null && webResult.header(); } } - + @Override public String getStyle() { SOAPBinding ann = implInfo.getEndpointClass().getAnnotation(SOAPBinding.class); @@ -483,5 +487,31 @@ } return "document"; } + + + + @Override + public Boolean isRPC(Method method) { + SOAPBinding ann = implInfo.getEndpointClass().getAnnotation(SOAPBinding.class); + if (ann != null) { + return ann.style().equals(SOAPBinding.Style.RPC); + } + ann = method.getAnnotation(SOAPBinding.class); + if (ann != null) { + return ann.style().equals(SOAPBinding.Style.RPC); + } + return Boolean.FALSE; + } + + /* + @Override + public Boolean hasOutMessage(Method method) { + Annotation anno = method.getAnnotation(Oneway.class); + if (anno != null) { + return Boolean.FALSE; + } + return Boolean.TRUE; + } + */ } Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java?view=diff&rev=529203&r1=529202&r2=529203 ============================================================================== --- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java (original) +++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java Mon Apr 16 03:57:38 2007 @@ -160,4 +160,8 @@ public Class getRequestWrapper(Method selected) { return null; } + + public Boolean isRPC(Method selected) { + return null; + } } Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=529203&r1=529202&r2=529203 ============================================================================== --- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original) +++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Mon Apr 16 03:57:38 2007 @@ -257,7 +257,6 @@ InterfaceInfo intf = getInterfaceInfo(); Map validMethods = new HashMap(); - for (Method m : methods) { if (isValidMethod(m)) { QName opName = getOperationName(intf, m); @@ -328,7 +327,6 @@ protected OperationInfo createOperation(ServiceInfo serviceInfo, InterfaceInfo intf, Method m) { OperationInfo op = intf.addOperation(getOperationName(intf, m)); - if (isWrapped(m)) { UnwrappedOperationInfo uOp = new UnwrappedOperationInfo(op); op.setUnwrappedOperation(uOp); @@ -444,14 +442,18 @@ final Class[] paramClasses = method.getParameterTypes(); // Setup the input message - MessageInfo inMsg = op.createMessage(getInputMessageName(op, method)); + MessageInfo inMsg = op.createMessage(this.getInputMessageName(op, method)); op.setInput(inMsg.getName().getLocalPart(), inMsg); for (int j = 0; j < paramClasses.length; j++) { if (isInParam(method, j)) { - final QName q = getInParameterName(op, method, j); + final QName q = getInParameterName(op, method, j); final QName q2 = getInPartName(op, method, j); MessagePartInfo part = inMsg.addMessagePart(q2); + //if Docoument ,Bare + if (!isRPC(method) && !isWrapped(method) && wrappedStyle == null) { + part.setElementQName(q); + } initializeParameter(part, paramClasses[j], method.getGenericParameterTypes()[j]); //TODO - RPC vs DOC (type vs element) if (isHeader(method, j)) { @@ -461,25 +463,34 @@ part.setIndex(j); } } - + if (hasOutMessage(method)) { // Setup the output message - MessageInfo outMsg = op.createMessage(createOutputMessageName(op, method)); + MessageInfo outMsg = op.createMessage(createOutputMessageName(op, method)); op.setOutput(outMsg.getName().getLocalPart(), outMsg); - final Class returnType = method.getReturnType(); if (!returnType.isAssignableFrom(void.class)) { - final QName q = getOutPartName(op, method, -1); + final QName q = getOutPartName(op, method, -1); + QName q2 = getOutParameterName(op, method, -1); MessagePartInfo part = outMsg.addMessagePart(q); + if (!isRPC(method) && !isWrapped(method)) { + part.setElementQName(q2); + } initializeParameter(part, method.getReturnType(), method.getGenericReturnType()); part.setIndex(-1); } for (int j = 0; j < paramClasses.length; j++) { if (isOutParam(method, j)) { + if (outMsg == null) { + outMsg = op.createMessage(createOutputMessageName(op, method)); + } final QName q = getOutPartName(op, method, j); final QName q2 = getOutParameterName(op, method, j); - MessagePartInfo part = outMsg.addMessagePart(q); + MessagePartInfo part = outMsg.addMessagePart(q); + if (!isRPC(method) && !isWrapped(method) && wrappedStyle == null) { + part.setElementQName(q2); + } initializeParameter(part, paramClasses[j], method.getGenericParameterTypes()[j]); part.setIndex(j); @@ -492,11 +503,12 @@ } } } + } initializeFaults(intf, op, method); } - + protected void createInputWrappedMessageParts(OperationInfo op, Method method, MessageInfo inMsg) { MessagePartInfo part = inMsg.addMessagePart(op.getInputName()); part.setElement(true); @@ -830,6 +842,7 @@ if (q != null) { return q; } + } throw new IllegalStateException("ServiceConfiguration must provide a value!"); } @@ -986,7 +999,8 @@ } return true; } - + + public String getStyle() { for (AbstractServiceConfiguration c : serviceConfigurations) { String style = c.getStyle(); @@ -995,6 +1009,16 @@ } } return "document"; + } + + public boolean isRPC(Method method) { + for (AbstractServiceConfiguration c : serviceConfigurations) { + Boolean b = c.isRPC(method); + if (b != null) { + return b.booleanValue(); + } + } + return true; } public void setWrapped(boolean style) { Modified: incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java?view=diff&rev=529203&r1=529202&r2=529203 ============================================================================== --- incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java (original) +++ incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java Mon Apr 16 03:57:38 2007 @@ -101,7 +101,6 @@ // TODO: @Test - @Ignore public void testDocWrapparBare() throws Exception { builder.setServiceClass(org.apache.hello_world_doc_wrapped_bare.Greeter.class); @@ -114,7 +113,7 @@ assertTrue(output.exists()); } - + //FIXME: CXF-519, CXF-533 @Test @Ignore @@ -256,5 +255,5 @@ private File getOutputFile(String fileName) { return new File(output, fileName); } - + }