You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Glen Mazza <gm...@talend.com> on 2011/09/29 23:33:18 UTC

Re: commits to JaxWsEndpointImpl (r1177248)

Hi Jim:

On 09/29/2011 06:05 AM, ema@apache.org wrote:
> Author: ema
> Date: Thu Sep 29 10:05:45 2011
> New Revision: 1177248
>
> URL: http://svn.apache.org/viewvc?rev=1177248&view=rev
> Log:
> [CXF-2006]:Check UnknownExtensibilityElement when RespectBindingFeature is enalbed
>
> Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
> URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java?rev=1177248&r1=1177247&r2=1177248&view=diff
> ==============================================================================
> --- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java (original)
> +++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java Thu Sep 29 10:05:45 2011

> +                            org.apache.cxf.common.i18n.Message message =
> +                                new org.apache.cxf.common.i18n.Message("UNKONW_REQUIRED_WSDL_BINDING", LOG);

Should be UNKNOWN_....

> +                            LOG.severe(message.toString());
> +                            throw new WebServiceException(message.toString());
> +                        }
> +                    }
> +                }
> +            }
> +        }
> +
> +    }
> +
>       private void extractWsdlEprs(EndpointInfo endpoint) {
>           //parse the EPR in wsdl
>           List<ExtensibilityElement>  portExtensors = endpoint.getExtensors(ExtensibilityElement.class);
>
> Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties
> URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties?rev=1177248&r1=1177247&r2=1177248&view=diff
> ==============================================================================
> --- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties (original)
> +++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties Thu Sep 29 10:05:45 2011
> @@ -33,4 +33,8 @@ SERVICECLASS_MUST_BE_SET = serviceClass
>   XMLSEEALSO_NULL_CLASS = A class listed in the XmlSeeAlso annotation of the service class %s cannot be found on the classpath. Index: %d of XmlSeeAlso class list.
>   WEBMETHOD_EXCLUDE_NOT_ALLOWED = The @javax.jws.WebMethod(exclude=true) cannot be used on a service endpoint interface. Method: {0}
>   WEBSERVICE_ANNOTATIONS_IS_LOADED_BY_OTHER_CLASSLOADER = The {0} annotation was already loaded by another classloader. Please check if there are multiple versions of the web service annotation jar in your classpath.
> +UNKONW_REQUIRED_WSDL_BINDING = RespectBindingFeature is enabled and there is wsdl:extensions that have the required=true attribute
> +attribute
> +

there *are* wsdl:extensions
also you're repeating the word "attribute" (look on last line above)

This error message seems unclear about the actual problem anyway--how 
about "Unknown wsdl:extension elements with required=true attribute 
found while RespectBindingFeature enabled"?


> +
>
>
> Added: cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/cxf2006/RespectBindingFeatureClientServerTest.java
> URL: http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/cxf2006/RespectBindingFeatureClientServerTest.java?rev=1177248&view=auto
> ==============================================================================
> --- cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/cxf2006/RespectBindingFeatureClientServerTest.java (added)
> +++ cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/cxf2006/RespectBindingFeatureClientServerTest.java Thu Sep 29 10:05:45 2011
> @@ -0,0 +1,64 @@
> +/**
> + * 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.cxf2006;
> +
> +import javax.xml.namespace.QName;
> +import javax.xml.ws.RespectBindingFeature;
> +import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
> +import org.apache.hello_world_rpclit.GreeterRPCLit;
> +import org.apache.hello_world_rpclit.SOAPServiceRPCLit;
> +import org.junit.BeforeClass;
> +import org.junit.Test;
> +
> +public class RespectBindingFeatureClientServerTest extends AbstractBusClientServerTestBase {
> +    public static final String PORT = Server.PORT;
> +    private final QName portName = new QName("http://apache.org/hello_world_rpclit", "SoapPortRPCLit");
> +    private SOAPServiceRPCLit service = new SOAPServiceRPCLit();
> +
> +    @BeforeClass
> +    public static void startServers() throws Exception {
> +        assertTrue("server did not launch correctly", launchServer(Server.class));
> +    }
> +
> +    @Test
> +    public void testRespectBindingFeature() throws Exception {
> +        try {
> +            GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class,
> +                                                    new RespectBindingFeature(true));
> +            updateAddressPort(greeter, PORT);
> +            greeter.greetMe("hello");
> +            fail("WebServiceException is expected");
> +        } catch (Exception ex) {
> +            assertTrue("WebServiceException is expected", ex instanceof javax.xml.ws.WebServiceException);
> +            assertTrue("RespectBindingFeature message is expceted",

expected

Regards,
Glen


-- 
Glen Mazza
Talend - http://www.talend.com/products/tsf
Blog - http://www.jroller.com/gmazza
Twitter - glenmazza


Re: commits to JaxWsEndpointImpl (r1177248)

Posted by Jim Ma <ma...@gmail.com>.
Thanks Glen for pointing out my typo and errors.

The error message you suggested is better , I just slightly changed it to
"Unknown wsd binding extension with required=true attribute found while
RespectBindingFeature enabled".

Thanks
Jim


On Fri, Sep 30, 2011 at 5:33 AM, Glen Mazza <gm...@talend.com> wrote:

> Hi Jim:
>
> On 09/29/2011 06:05 AM, ema@apache.org wrote:
>
>> Author: ema
>> Date: Thu Sep 29 10:05:45 2011
>> New Revision: 1177248
>>
>> URL: http://svn.apache.org/viewvc?**rev=1177248&view=rev<http://svn.apache.org/viewvc?rev=1177248&view=rev>
>> Log:
>> [CXF-2006]:Check UnknownExtensibilityElement when RespectBindingFeature is
>> enalbed
>>
>> Modified: cxf/trunk/rt/frontend/jaxws/**src/main/java/org/apache/cxf/**
>> jaxws/support/**JaxWsEndpointImpl.java
>> URL: http://svn.apache.org/viewvc/**cxf/trunk/rt/frontend/jaxws/**
>> src/main/java/org/apache/cxf/**jaxws/support/**
>> JaxWsEndpointImpl.java?rev=**1177248&r1=1177247&r2=1177248&**view=diff<http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java?rev=1177248&r1=1177247&r2=1177248&view=diff>
>> ==============================**==============================**
>> ==================
>> --- cxf/trunk/rt/frontend/jaxws/**src/main/java/org/apache/cxf/**
>> jaxws/support/**JaxWsEndpointImpl.java (original)
>> +++ cxf/trunk/rt/frontend/jaxws/**src/main/java/org/apache/cxf/**
>> jaxws/support/**JaxWsEndpointImpl.java Thu Sep 29 10:05:45 2011
>>
>
>  +                            org.apache.cxf.common.i18n.**Message message
>> =
>> +                                new org.apache.cxf.common.i18n.**
>> Message("UNKONW_REQUIRED_WSDL_**BINDING", LOG);
>>
>
> Should be UNKNOWN_....
>
>  +                            LOG.severe(message.toString())**;
>> +                            throw new WebServiceException(message.**
>> toString());
>> +                        }
>> +                    }
>> +                }
>> +            }
>> +        }
>> +
>> +    }
>> +
>>      private void extractWsdlEprs(EndpointInfo endpoint) {
>>          //parse the EPR in wsdl
>>          List<ExtensibilityElement>  portExtensors =
>> endpoint.getExtensors(**ExtensibilityElement.class);
>>
>> Modified: cxf/trunk/rt/frontend/jaxws/**src/main/java/org/apache/cxf/**
>> jaxws/support/Messages.**properties
>> URL: http://svn.apache.org/viewvc/**cxf/trunk/rt/frontend/jaxws/**
>> src/main/java/org/apache/cxf/**jaxws/support/Messages.**
>> properties?rev=1177248&r1=**1177247&r2=1177248&view=diff<http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/Messages.properties?rev=1177248&r1=1177247&r2=1177248&view=diff>
>> ==============================**==============================**
>> ==================
>> --- cxf/trunk/rt/frontend/jaxws/**src/main/java/org/apache/cxf/**
>> jaxws/support/Messages.**properties (original)
>> +++ cxf/trunk/rt/frontend/jaxws/**src/main/java/org/apache/cxf/**
>> jaxws/support/Messages.**properties Thu Sep 29 10:05:45 2011
>> @@ -33,4 +33,8 @@ SERVICECLASS_MUST_BE_SET = serviceClass
>>  XMLSEEALSO_NULL_CLASS = A class listed in the XmlSeeAlso annotation of
>> the service class %s cannot be found on the classpath. Index: %d of
>> XmlSeeAlso class list.
>>  WEBMETHOD_EXCLUDE_NOT_ALLOWED = The @javax.jws.WebMethod(exclude=**true)
>> cannot be used on a service endpoint interface. Method: {0}
>>  WEBSERVICE_ANNOTATIONS_IS_**LOADED_BY_OTHER_CLASSLOADER = The {0}
>> annotation was already loaded by another classloader. Please check if there
>> are multiple versions of the web service annotation jar in your classpath.
>> +UNKONW_REQUIRED_WSDL_BINDING = RespectBindingFeature is enabled and there
>> is wsdl:extensions that have the required=true attribute
>> +attribute
>> +
>>
>
> there *are* wsdl:extensions
> also you're repeating the word "attribute" (look on last line above)
>
> This error message seems unclear about the actual problem anyway--how about
> "Unknown wsdl:extension elements with required=true attribute found while
> RespectBindingFeature enabled"?
>
>
>  +
>>
>>
>> Added: cxf/trunk/systests/**uncategorized/src/test/java/**
>> org/apache/cxf/cxf2006/**RespectBindingFeatureClientSer**verTest.java
>> URL: http://svn.apache.org/viewvc/**cxf/trunk/systests/**
>> uncategorized/src/test/java/**org/apache/cxf/cxf2006/**
>> RespectBindingFeatureClientSer**verTest.java?rev=1177248&view=**auto<http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/cxf2006/RespectBindingFeatureClientServerTest.java?rev=1177248&view=auto>
>> ==============================**==============================**
>> ==================
>> --- cxf/trunk/systests/**uncategorized/src/test/java/**
>> org/apache/cxf/cxf2006/**RespectBindingFeatureClientSer**verTest.java
>> (added)
>> +++ cxf/trunk/systests/**uncategorized/src/test/java/**
>> org/apache/cxf/cxf2006/**RespectBindingFeatureClientSer**verTest.java Thu
>> Sep 29 10:05:45 2011
>> @@ -0,0 +1,64 @@
>> +/**
>> + * 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<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.cxf2006;
>> +
>> +import javax.xml.namespace.QName;
>> +import javax.xml.ws.**RespectBindingFeature;
>> +import org.apache.cxf.testutil.**common.**AbstractBusClientServerTestBas
>> **e;
>> +import org.apache.hello_world_rpclit.**GreeterRPCLit;
>> +import org.apache.hello_world_rpclit.**SOAPServiceRPCLit;
>> +import org.junit.BeforeClass;
>> +import org.junit.Test;
>> +
>> +public class RespectBindingFeatureClientSer**verTest extends
>> AbstractBusClientServerTestBas**e {
>> +    public static final String PORT = Server.PORT;
>> +    private final QName portName = new QName("http://apache.org/**
>> hello_world_rpclit <http://apache.org/hello_world_rpclit>",
>> "SoapPortRPCLit");
>> +    private SOAPServiceRPCLit service = new SOAPServiceRPCLit();
>> +
>> +    @BeforeClass
>> +    public static void startServers() throws Exception {
>> +        assertTrue("server did not launch correctly",
>> launchServer(Server.class));
>> +    }
>> +
>> +    @Test
>> +    public void testRespectBindingFeature() throws Exception {
>> +        try {
>> +            GreeterRPCLit greeter = service.getPort(portName,
>> GreeterRPCLit.class,
>> +                                                    new
>> RespectBindingFeature(true));
>> +            updateAddressPort(greeter, PORT);
>> +            greeter.greetMe("hello");
>> +            fail("WebServiceException is expected");
>> +        } catch (Exception ex) {
>> +            assertTrue("**WebServiceException is expected", ex
>> instanceof javax.xml.ws.**WebServiceException);
>> +            assertTrue("**RespectBindingFeature message is expceted",
>>
>
> expected
>
> Regards,
> Glen
>
>
> --
> Glen Mazza
> Talend - http://www.talend.com/**products/tsf<http://www.talend.com/products/tsf>
> Blog - http://www.jroller.com/gmazza
> Twitter - glenmazza
>
>