Yep. The targetNamespace on the SEI controls the namespace for the messages and the portType (and possibly the binding). The targetNamespace on the Impl controls the namespace of the service. If they aren't the same, two wsdl's are generated with the service wsdl importing the other.

Dan



On Jun 4, 2008, at 5:41 PM, Boxiong Ding wrote:

I found out what the problem is. I put targetNamespace into my impl class. when I moved it to SEI it works.
Boxiong


----- Original Message ----
From: Boxiong Ding <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, June 4, 2008 12:55:38 PM
Subject: how to control the target namespace for service?

I am using CXF-2.1 to generate WSDL from Java classes. I have two package: one for service interface/impl and the other for objects. I have tried to specify targetNamespace in @WebService annotation and use -t option of java2ws. But neither generate my desired namespace for my service even the namespace is generated correctly for object package (from package-info.java). Instead, it always convert package name to name space by putting http in the front.

Here is the command I am using:
java2ws -wsdl -o MyWSDL.wsdl -createxsdimports -d ws -verbose -t http://mynamesapce.mydomain.com/services/myservice MyServiceClass

Is this a bug or I am missing something?

Boxiong



---
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog




Reply via email to