cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Diephouse <...@envoisolutions.com>
Subject Re: svn commit: r469376 - in /incubator/cxf/trunk/rt: core/src/main/java/org/apache/cxf/interceptor/ frontend/jaxws/src/test/java/org/apache/cxf/jaxws/
Date Tue, 31 Oct 2006 06:08:23 GMT
James Mao wrote:
> Hi Dan,
> Yes, i awared, that's why i just use it to log, i'm not failed the 
> processing.
 From what I can tell you're using it to check that the parameter name 
from the URI matches the parameter name. And the annotations don't 
always have that name in code first scenarios. So that means that 
processing will fail even when its not necessarily supposed to. So this 
is important.
> If i can not use jaxws stuff in that module , i guess we should remove 
> the dependencies from the POM
Yes, that would be good but I think the unit tests depend on it. This is 
part of the reason we need to refactor the tools...
> Yes, i will use the messagePartInfo.getConcreteName().getLocalPart(), 
> that's next story.
>
Great. Also noticed you seem to be depending on the parameter order in 
the URL. Why not just match up the keys to the message part local name?
> It's not a part of HTTP binding, and i don't think in GET we need to 
> convert to the document, it'll slow down the processing.
>
Well it is *a* binding to HTTP. I don't care that much, but it does all 
the dirty work for you and I doubt it slows things down that much.
> Cheers,
> James.
>
> Dan Diephouse 写道:
>> Hi James,
>> Are you aware this information is in the service model? Are you also 
>> aware that this information often times is NOT in the annotations - 
>> for instance when someone does code first services? There should 
>> hardly ever be any reason to use the jax-ws annotations outside the 
>> JaxWsServiceFactory/JaxWsServiceConfiguration classes. Just do 
>> key.equals(messagePartInfo.getConcreteName().getLocalPart()) to see 
>> if they match.
>>
>> Also you might want to look at using the utility code in the HTTP 
>> binding to turn parameters and their values into a document which 
>> conforms to the schema.
>>
>> - Dan
>>
>>
>> mmao@apache.org wrote:
>>> +    private boolean isValidParameter(Annotation[][] 
>>> parameterAnnotation, int index, String parameterName) {
>>> +        if (parameterAnnotation == null || 
>>> parameterAnnotation.length < index) {
>>> +            return true;
>>> +        }
>>> +        Annotation[] annotations = parameterAnnotation[index];
>>> +        if (annotations == null || annotations.length < 1) {
>>> +            return true;
>>> +        }
>>> +        WebParam webParam = null;
>>> +        for (Annotation annotation : annotations) {
>>> +            if (annotation.annotationType() == WebParam.class) {
>>> +                webParam = (WebParam) annotation;
>>> +            }
>>> +        }
>>> +        if (webParam == null +            || 
>>> StringUtils.isEmpty(webParam.name()) +            || 
>>> webParam.name().equals(parameterName)) {
>>> +            return true;
>>> +        }
>>> +        LOG.warning("The parameter name [" + parameterName 
>>> +                    + "] is not match the one defined in the 
>>> WebParam name [" + webParam.name() + "]");
>>> +        return false;
>>> +    }
>>>   
>> Dan Diephouse
>> Envoi Solutions
>> http://envoisolutions.com
>> http://netzooid.com/blog
>>
>>
>


-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com
http://netzooid.com/blog


Mime
View raw message