Our WSDL to Java Maven plugin does use generated-sources as its default (to store the generated Java artifacts), but apparently the Java to WSDL uses just "generated", perhaps because we didn't want to mix WSDL files with Java files for larger projects using a combination of the two tools. If your business needs require a different output folder for the WSDL than CXF's default, I'd go ahead and just use the option CXF already provides to change the output folder that Dan showed below.

Rather than have CXF change its defaults to cover up Metro's configuration shortcomings, it would be better if you wish to submit a bug report to the Metro team to get those shortcomings fixed: http://java.net/jira/browse/JAX_WS .

Glen

On 08/24/2012 05:23 AM, Pavel Khodchenkov wrote:
Hi,
If you change the CXF plugin to generate the WSDL into 
${project.build.directory}/generated-sources/wsdl, then you get the EXACT same 
wsdl as if you generate elsewhere, but you no longer get the warning from the 
JAX-WS plugin.
----------------------------------

I have tried to apply proposed solution, but still have warnings (suppose I am 
doing smth wrong :) ).
Can you please send me the modified maven project where the wsdl generated by 
CXF is accepted by Metro without warning?

-----Original Message-----
From: Daniel Kulp [mailto:[email protected]]
Sent: Thursday, August 23, 2012 9:08 PM
To: [email protected]
Subject: Re: cxf-java2ws-plugin wsdl generation on java 7


I honestly think you've hit a bug in the jaxws-maven-plugin and not CXF.

If you change the CXF plugin to generate the WSDL into 
${project.build.directory}/generated-sources/wsdl, then you get the EXACT same 
wsdl as if you generate elsewhere, but you no longer get the warning from the 
JAX-WS plugin.

Also, if you add:
                 
<resourceDestDir>${project.build.directory}/generated/wsdl</resourceDestDir>
                  <inlineSchemas>true</inlineSchemas>
to the METRO profiles call to wsgen and run "mvn  clean install -PMETRO" and then 
"mvn install -PMETRO", you get the same error.



Basically, it looks like the wsimport thing needs to have the "generated" 
directory on the class path somehow.    If you add:

     <build>
          <resources>
               <resource>
                     <directory>${project.build.directory}/generated</directory>
               </resource>
          </resources>
     </build>

to the pom to make sure the generated directory is on the class path, then it 
also runs without the error.


Dan



On Aug 22, 2012, at 8:25 AM, Pavel Khodchenkov 
<[email protected]> wrote:

Hi there,
I have tried Metro and it was able to generate the wsdl without this warning. 
The problem is in having the XmlRootElement annotation in one of the entities 
when this entity is placed inside a list :D . I have extracted the most simple 
reproducible use case (please see maven 3 project attached) which produce such 
warning. However , this warning in this sample project is generated also on JDK 
6 when using CXF java2wsdl (Metro works fine). Once XmlRootElement annotation 
is removed from MultiItemEntitlementDTO then CXF also generates a valid wsdl. 
Please take a look.

P.S Some of my services were exposed as SOAP as REST at the same time, so 
XmlRootElement annotation was required on entity classes , otherwise rest invocation 
fails with 'No message body writer has been found for class' and  <response> 
element in wadl will not have type declaration.
-----Original Message-----
From: Glen Mazza [mailto:[email protected]]
Sent: Tuesday, August 21, 2012 10:02 PM
To: [email protected]
Subject: Re: cxf-java2ws-plugin wsdl generation on java 7

It might be good to post a *minimal* Java class that reproduces the same error; 
basically rip out as much as you can from the SEI to give the simplest class 
that provides the same error.  Checking to see what Metro does (same error? no 
error?) might also be informative:
http://www.jroller.com/gmazza/entry/java_first_web_service.

Offhand, I know the default JAXB is different between Java 6 and 7
(JAXB
2.1 vs. JAXB 2.2), so that could be the issue.

Glen

On 08/20/2012 06:33 AM, Pavel Khodchenkov wrote:
Hi folks,

When I use jdk 7 I have the following warning in jaxws-maven-plugin
when importing the wsdl generated by cxf-java2ws-plugin 2.6.0:

[WARNING] src-resolve: Cannot resolve the name
'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.

  line 163 of
file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
r
ansactionService.wsdl#types?schema1

[WARNING] src-resolve: Cannot resolve the name
'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.

  line 163 of
file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
r
ansactionService.wsdl#types?schema1

And the stub generated this wsdl does not work very well: server
fails with namespace mismatch.

There is no such issues when I use jdk 6.

I have attached both wsdls generated by jdk 6 and jdk 7.

Does somebody have any ideas?

<test-cxf-java2wsdl.zip>
--
Daniel Kulp
[email protected] - http://dankulp.com/blog Talend Community Coder - 
http://coders.talend.com


Reply via email to