Return-Path: Delivered-To: apmail-incubator-cxf-dev-archive@locus.apache.org Received: (qmail 99442 invoked from network); 30 Oct 2007 21:54:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2007 21:54:01 -0000 Received: (qmail 59352 invoked by uid 500); 30 Oct 2007 21:53:48 -0000 Delivered-To: apmail-incubator-cxf-dev-archive@incubator.apache.org Received: (qmail 59319 invoked by uid 500); 30 Oct 2007 21:53:47 -0000 Mailing-List: contact cxf-dev-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-dev@incubator.apache.org Received: (qmail 59309 invoked by uid 99); 30 Oct 2007 21:53:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2007 14:53:47 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=FM_FAKE_HELO_VERIZON,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of glen.mazza@verizon.net designates 206.46.169.133 as permitted sender) Received: from [206.46.169.133] (HELO vms169133pub.verizon.net) (206.46.169.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2007 21:53:48 +0000 Received: from [192.168.1.46] ([70.17.120.48]) by vms169133.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JQQ002OXVDCPV22@vms169133.mailsrvcs.net> for cxf-dev@incubator.apache.org; Tue, 30 Oct 2007 16:51:12 -0500 (CDT) Date: Tue, 30 Oct 2007 17:51:14 -0400 From: Glen Mazza Subject: Re: svn commit: r590451 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/service/model/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ systests/src/test/java/org/apache/cxf/systest/jaxws/ In-reply-to: <200710301731.56642.dkulp@apache.org> To: cxf-dev@incubator.apache.org Message-id: <1193781074.4664.5.camel@gmazza-desktop> MIME-version: 1.0 X-Mailer: Evolution 2.10.1 Content-type: text/plain Content-transfer-encoding: 7bit References: <20071030205258.062D31A9832@eris.apache.org> <1193778851.2483.2.camel@gmazza-desktop> <200710301731.56642.dkulp@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org I can understand clients still being allowed to run if the WSDL has been expanded to accomodate more operations--if nothing else, Metro operates that way. But server-side, what you're saying is that a web service should be allowed to operate inconsistently from its WSDL--i.e., not have a 1-to-1 mapping between operations and functions. The benefits for allowing that seem somewhat more questionable. Glen Am Dienstag, den 30.10.2007, 17:31 -0400 schrieb Daniel Kulp: > It actually allows both clients and servers to work. > > For clients, the interface passed to the service.create thing won't have > the methods so there really isn't a way to invoke it. > > For servers, the operations that DO map to a method will work fine. For > others, when it tries to parse the request, it won't find a usable > operation and a fault would be raised. > > Dan > > > On Tuesday 30 October 2007, Glen Mazza wrote: > > You mean, allow *clients* to work if they don't have methods for some > > of the operations defined in the WSDL, correct? If I understand > > correctly, that was the concern with CXF-940. > > > > Glen > > > > Am Dienstag, den 30.10.2007, 20:52 +0000 schrieb dkulp@apache.org: > > > Author: dkulp > > > Date: Tue Oct 30 13:52:52 2007 > > > New Revision: 590451 > > > > > > URL: http://svn.apache.org/viewvc?rev=590451&view=rev > > > Log: > > > CXF-940 - Allow services to work if they don't have methods for some > > > of the operations in the wsdl. The methods it does have will work. > > > > > > Added: > > > > > > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ja > > >xws/DocLitWrappedCodeFirstServiceMissingOps.java (with props) > > > Modified: > > > > > > incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/B > > >indingInfo.java > > > incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/I > > >nterfaceInfo.java > > > incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/ > > >service/factory/ReflectionServiceFactoryBean.java > > > incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/ > > >service/factory/SimpleMessages.properties > > > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ja > > >xws/ClientServerMiscTest.java > > > > > > Modified: > > > incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/B > > >indingInfo.java URL: > > > http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/o > > >rg/apache/cxf/service/model/BindingInfo.java?rev=590451&r1=590450&r2= > > >590451&view=diff > > > ==================================================================== > > >========== --- > > > incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/B > > >indingInfo.java (original) +++ > > > incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/B > > >indingInfo.java Tue Oct 30 13:52:52 2007 @@ -101,6 +101,20 @@ > > > > > > operations.put(operation.getName(), operation); > > > } > > > + > > > + /** > > > + * Removes an operation from this service. > > > + * > > > + * @param operation the operation. > > > + */ > > > + public void removeOperation(BindingOperationInfo operation) { > > > + if (operation.getName() == null) { > > > + throw new NullPointerException( > > > + new Message("BINDING.OPERATION.NAME.NOT.NULL", > > > LOG).toString()); + } > > > + > > > + operations.remove(operation.getName()); > > > + } > > > > > > /** > > > * Returns the operation info with the given name, if found. > > > > > > Modified: > > > incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/I > > >nterfaceInfo.java URL: > > > http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/o > > >rg/apache/cxf/service/model/InterfaceInfo.java?rev=590451&r1=590450&r > > >2=590451&view=diff > > > ==================================================================== > > >========== --- > > > incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/I > > >nterfaceInfo.java (original) +++ > > > incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/I > > >nterfaceInfo.java Tue Oct 30 13:52:52 2007 @@ -85,6 +85,15 @@ > > > void addOperation(OperationInfo operation) { > > > operations.put(operation.getName(), operation); > > > } > > > + > > > + /** > > > + * Removes an operation from this service. > > > + * > > > + * @param operation the operation. > > > + */ > > > + public void removeOperation(OperationInfo operation) { > > > + operations.remove(operation.getName()); > > > + } > > > > > > /** > > > * Returns the operation info with the given name, if found. > > > > > > 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/ReflectionServiceFactory > > >Bean.java?rev=590451&r1=590450&r2=590451&view=diff > > > ==================================================================== > > >========== --- > > > 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 Tue Oct 30 13:52:52 > > > 2007 @@ -303,6 +303,7 @@ > > > } > > > > > > protected void initializeWSDLOperations() { > > > + List removes = new > > > ArrayList(); Method[] methods = > > > serviceClass.getMethods(); > > > Arrays.sort(methods, new MethodComparator()); > > > > > > @@ -329,17 +330,29 @@ > > > } > > > > > > if (selected == null) { > > > - throw new ServiceConstructionException(new > > > Message("NO_METHOD_FOR_OP", LOG, o.getName())); + > > > LOG.log(Level.WARNING, "NO_METHOD_FOR_OP", o.getName()); + > > > removes.add(o); > > > + } else { > > > + initializeWSDLOperation(intf, o, selected); > > > } > > > - > > > - initializeWSDLOperation(intf, o, selected); > > > + } > > > + for (OperationInfo op : removes) { > > > + intf.removeOperation(op); > > > } > > > > > > //Some of the operations may have switched from unwrapped > > > to wrapped. Update the bindings. for (ServiceInfo service : > > > getService().getServiceInfos()) { for (BindingInfo bi : > > > service.getBindings()) { + List > > > biremoves = new ArrayList(); for > > > (BindingOperationInfo binfo : bi.getOperations()) { - > > > binfo.updateUnwrappedOperation(); > > > + if (removes.contains(binfo.getOperationInfo())) > > > { + biremoves.add(binfo); > > > + } else { > > > + binfo.updateUnwrappedOperation(); > > > + } > > > + } > > > + for (BindingOperationInfo binfo : biremoves) { > > > + bi.removeOperation(binfo); > > > } > > > } > > > } > > > > > > Modified: > > > incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/ > > >service/factory/SimpleMessages.properties URL: > > > http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/ > > >src/main/java/org/apache/cxf/service/factory/SimpleMessages.propertie > > >s?rev=590451&r1=590450&r2=590451&view=diff > > > ==================================================================== > > >========== --- > > > incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/ > > >service/factory/SimpleMessages.properties (original) +++ > > > incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/ > > >service/factory/SimpleMessages.properties Tue Oct 30 13:52:52 2007 @@ > > > -19,7 +19,7 @@ > > > # > > > # > > > COULD_NOT_FIND_PORTTYPE = Could not find portType named {0} > > > -NO_METHOD_FOR_OP = Could not find a matching method for operation > > > {0} +NO_METHOD_FOR_OP = Could not find a matching method for > > > operation {0}. Operation will be unavailable. > > > COULD_NOT_SET_WRAPPER_STYLE = Service class: {0} contains overloaded > > > operation can not use wrapper style USING_PROXY_FOR_SERVICE = > > > Service class: {0} is a java.lang.reflect.Proxy instance. This is > > > known not to work well as \ annotations on the real instance are not > > > available. We suggest overriding the ServiceClass via spring config > > > or \ > > > > > > Modified: > > > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ja > > >xws/ClientServerMiscTest.java URL: > > > http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/j > > >ava/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?rev=590451 > > >&r1=590450&r2=590451&view=diff > > > ==================================================================== > > >========== --- > > > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ja > > >xws/ClientServerMiscTest.java (original) +++ > > > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ja > > >xws/ClientServerMiscTest.java Tue Oct 30 13:52:52 2007 @@ -198,6 > > > +198,23 @@ > > > } > > > > > > @Test > > > + public void testMissingMethods() throws Exception { > > > + QName portName = new > > > QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstSer > > >vice", + "DocLitWrappedCodeFirstServicePort"); > > > + QName servName = new > > > QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstSer > > >vice", + "DocLitWrappedCodeFirstService"); > > > + > > > + Service service = Service.create(new > > > URL(ServerMisc.DOCLIT_CODEFIRST_URL + "?wsdl"), + > > > servName); > > > + DocLitWrappedCodeFirstServiceMissingOps port = > > > service.getPort(portName, + > > > DocLitWrappedCodeFirstServiceMissingOps.class); + > > > + int[] ret = port.echoIntArray(new int[] {1, 2}); > > > + assertNotNull(ret); > > > + //port.arrayOutput(); > > > + } > > > + > > > + @Test > > > public void testStringListOutDocLitNoWsdl() throws Exception { > > > QName portName = new > > > QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstSer > > >vice", "DocLitWrappedCodeFirstServicePort"); > > > > > > Added: > > > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ja > > >xws/DocLitWrappedCodeFirstServiceMissingOps.java URL: > > > http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/j > > >ava/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceMissing > > >Ops.java?rev=590451&view=auto > > > ==================================================================== > > >========== --- > > > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ja > > >xws/DocLitWrappedCodeFirstServiceMissingOps.java (added) +++ > > > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ja > > >xws/DocLitWrappedCodeFirstServiceMissingOps.java Tue Oct 30 13:52:52 > > > 2007 @@ -0,0 +1,48 @@ > > > +/** > > > + * Licensed to the Apache Software Foundation (ASF) under one > > > + * or more contributor license agreements. See the NOTICE file > > > + * distributed with this work for additional information > > > + * regarding copyright ownership. The ASF licenses this file > > > + * to you under the Apache License, Version 2.0 (the > > > + * "License"); you may not use this file except in compliance > > > + * with the License. You may obtain a copy of the License at > > > + * > > > + * http://www.apache.org/licenses/LICENSE-2.0 > > > + * > > > + * Unless required by applicable law or agreed to in writing, > > > + * software distributed under the License is distributed on an > > > + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY > > > + * KIND, either express or implied. See the License for the > > > + * specific language governing permissions and limitations > > > + * under the License. > > > + */ > > > +package org.apache.cxf.systest.jaxws; > > > + > > > +import java.util.Vector; > > > + > > > +import javax.jws.WebMethod; > > > +import javax.jws.WebParam; > > > +import javax.jws.WebService; > > > +import javax.jws.soap.SOAPBinding; > > > + > > > + > > > +@WebService(name = "DocLitWrappedCodeFirstService", > > > + targetNamespace = > > > "http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService") > > > +@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, > > > + use = SOAPBinding.Use.LITERAL) > > > +public interface DocLitWrappedCodeFirstServiceMissingOps { > > > + > > > + @WebMethod > > > + String[] arrayOutput(); > > > + > > > + @WebMethod > > > + String arrayInput( > > > + @WebParam(name = "input") String[] inputs); > > > + > > > + @WebMethod > > > + Vector listOutput(); > > > + > > > + @WebMethod > > > + int[] echoIntArray(int[] ar); > > > + > > > +} > > > > > > Propchange: > > > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ja > > >xws/DocLitWrappedCodeFirstServiceMissingOps.java > > > -------------------------------------------------------------------- > > >---------- svn:eol-style = native > > > > > > Propchange: > > > incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ja > > >xws/DocLitWrappedCodeFirstServiceMissingOps.java > > > -------------------------------------------------------------------- > > >---------- svn:keywords = Rev Date > > >