Hi Dan,
Just check the code, the WebParam is not part of Jaxws it's part of JSR181.
As i said, i'll change that to
messagePartInfo.getConcreteName().getLocalPart(), that's next story.
And also will add a code first test for this.
As i said in previous other email, this is just the first tryout, i will
have two commits to solve the parameter order and encoding/decoding issues.
The HttpBinding will slow down the processing in case of GET, first it
have to build the doc and then it will add the xmlmessageinterceptor in
the middle, in will go through the xmlmessageininerceptor, and
xmlmessageininterceptor will then go through the bare/wrapped
interceptors, it'll do unmarshall work. it definitely slower than get
the operation name and parameters directly.
Anyway, i think it's just different user scenarios. what the GET i just
checked in will allow user to expose the service through HTTP GET, no
matter which binding they are using (SOAP1.1 SOAP1.2
and XMLbinding etc.) it's sort of RESTlike service, but
it's different from the HTTP binding which in my opinion is a REST
binding. So in case of GET in HTTP binding, it's fine.
Cheers,
James.
Dan Diephouse 写道:
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
[EMAIL PROTECTED] 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