Put it on the @WebService annotation in the code.
On Sat, Nov 15, 2008 at 7:13 PM, snowbug <[EMAIL PROTECTED]> wrote: > > I think that is definitely the reason why it's splitted into two wsdl files. > However, can you tell me how to set the target namespace? Looks like the > <jaxws:endpoint> tag does not allow targetNamespace attribute, and setting > the "targetNamespace" in the "@WebService" annotation of my UserService does > not help. > > I'm using the CXF Spring configuration file and the configuration looks like > this: > <jaxws:endpoint id="userService" implementor="#userServiceBean" > endpointName="e:UserServiceEndpoint" > serviceName="s:UserService" > address="/user" > xmlns:e="http://service.jaxws.cxf.apache.org/endpoint" > xmlns:s="http://service.jaxws.cxf.apache.org/service" /> > > Right now, the annotation on the UserService is bare-bone like this: > @WebService > public interface UserService { > ... > } > > The main wsdl file begins like this: > <wsdl:definitions name="UserService" > targetNamespace="http://service.jaxws.cxf.apache.org/service"> > <wsdl:import > location="http://localhost:8080/services/user?wsdl=UserService.wsdl" > namespace="http://service.semarca.com/"> > </wsdl:import> > > And the imported wsdl file begins like this: > <wsdl:definitions name="UserService" > targetNamespace="http://service.mycompany.com/"> > > Any idea where I need to change to have it setup correctly? I couldn't find > any additional information from the official CXF online document. > > Thank you, > > > > Benson Margulies-4 wrote: >> >> If you spec out the target namespaces to be the same all around, it >> will all land in the same place. >> >> When you switch from Simple to JAX-WS, you also switch from Aegis to >> JAX-B. >> >> On Sat, Nov 15, 2008 at 1:39 AM, snowbug <[EMAIL PROTECTED]> wrote: >>> >>> I just found out that the schema for the User object is actually there >>> with >>> the jax-ws implementation. >>> >>> What happens is that in the generated default wsdl, right after the open >>> wsdl element, there is an import line like this: >>> <wsdl:import >>> location="http://localhost:8080/services/user?wsdl=UserService.wsdl" >>> namespace="http://service.mycompany.com/"></wsdl:import> >>> >>> And when I type in that address in browser, I see all the schema >>> definitions >>> for the classes referenced. >>> >>> >>> snowbug wrote: >>>> >>>> Thanks for the reply. >>>> >>>> I didn't specify any databinding. For the jax-ws setting, I used: >>>> <!-- The user soap service --> >>>> <bean id="userServiceBean" >>>> class="com.mycompany.service.UserServiceBean" /> >>>> >>>> <!-- JAX-WS based configuration --> >>>> <jaxws:endpoint id="userService" implementor="#userServiceBean" >>>> endpointName="e:userServiceEndpoint" >>>> serviceName="s:userService" >>>> address="/user" >>>> xmlns:e="http://service.jaxws.cxf.apache.org/endpoint" >>>> xmlns:s="http://service.jaxws.cxf.apache.org/service" /> >>>> >>>> >>>> For the simple front end based configuration, I used: >>>> <simple:server id="userService" >>>> serviceClass="com.mycompany.service.UserService" >>>> serviceBean="#userServiceBean" >>>> address="/user"/> >>>> >>>> As shown above, they both refer to the "userServiceBean" as the actual >>>> implementor bean class. >>>> >>>> >>>> >>>> Benson Margulies-4 wrote: >>>>> >>>>> The issue is probably not the front-end but rather the data binding. >>>>> Can you post the full config of the failing case? >>>>> >>>>> On Fri, Nov 14, 2008 at 4:00 AM, snowbug <[EMAIL PROTECTED]> wrote: >>>>>> >>>>>> Hi, >>>>>> >>>>>> I am trying out CXF and configured my service use both the simple >>>>>> front >>>>>> end >>>>>> and the jax-ws front end. To illustrate the problem, let me briefly >>>>>> describe >>>>>> the service first. >>>>>> >>>>>> The service expose a method: >>>>>> public User getUser(int id); >>>>>> >>>>>> And the User class is a standard POJO bean that has properties like: >>>>>> firstName, lastName, address, etc, with corresponding getters and >>>>>> setters. >>>>>> >>>>>> What I noticed is that using the simple front end, the wsdl file >>>>>> contains a >>>>>> generated schema definition for the User class. However, the jax-ws >>>>>> front >>>>>> end will leave that off. >>>>>> >>>>>> I have two questions: >>>>>> 1. Is the schema definition for the User class important? If missing, >>>>>> how >>>>>> does the client know what to expect? >>>>>> 2. How to configure the jax-ws front end to also include this schema >>>>>> definition for the User class, if possible? >>>>>> >>>>>> Thank you in advance for your help. >>>>>> -- >>>>>> View this message in context: >>>>>> http://www.nabble.com/Including-schema-for-bean-classes-in-thw-wsdl-file-using-JAX-WS-tp20496933p20496933.html >>>>>> Sent from the cxf-user mailing list archive at Nabble.com. >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Including-schema-for-bean-classes-in-the-wsdl-file-using-JAX-WS-tp20496933p20512939.html >>> Sent from the cxf-user mailing list archive at Nabble.com. >>> >>> >> >> > > -- > View this message in context: > http://www.nabble.com/Including-schema-for-bean-classes-in-the-wsdl-file-using-JAX-WS-tp20496933p20520962.html > Sent from the cxf-user mailing list archive at Nabble.com. > >
