|
FAQ has been edited by Daniel Kulp (Oct 05, 2007). Content:Frequently Asked QuestionsJAX-WS RelatedThe parts in my generated wsdl are names "arg0", "arg1", etc... Why can't it generate better names?Official answer: The JAX-WS spec (specifically section 3.6.1) mandates that it be generated this way. To customize the name, you have to use an @WebParam(name = "blah") annotation (@WebResult for the return value) to specify better names. Reason: One of the mysteries of java is that abstract methods (and thus interface methods) do NOT get their parameter names compiled into them even with debug info. Thus, when the service model is built from an interface, there is no way to determine the names that were using in the original code. If the service is built from a concrete class (instead of an interface) AND the class was compiled with debug info, we can get the parameter names. The simple frontend does this. However, this could cause potential problems. For example, when you go from developement to production, you may turn off debug information (remove -g from javac flags) and suddenly the application may break since the generated wsdl (and thus expect soap messages) would change. Thus, the JAX-WS spec writers went the safe route and mandate that you have to use the @WebParam annotations to specify the more descriptive names. Spring RelatedWhen using Spring AOP to enable things like transactions and security, the generated WSDL is very messed up with wrong namespaces, part names, etc...Reason: When using Spring AOP, spring injects a proxy to the bean into CXF instead of the actual bean. The Proxy does not have the annotations on it (like the @WebService annotation) so we cannot query the information directly from the object like we can in the non-AOP case. The "fix" is to also specify the actual serviceClass of the object in the spring config: <jaxws:server
id="myService"
serviceClass="my.package.MyServiceImpl"
serviceBean="#myServiceImpl"
address="/MyService" />
or: <jaxws:endpoint
id="myService"
implementorClass="my.package.MyServiceImpl"
implementor="#myServiceImpl"
address="/MyService" />
|
Unsubscribe or edit your notifications preferences
