Generating a WSDL-first web service using SoapUI tool
Hi,
i have made the following set up as mentioned in Soapui-Cookboook by rupert anderson,to generate a WSDL-first web serviceusing SoapUI tool , but on trying to 'Generate' i get an error:
Error message::
Unexpected argument: invoice_v1.wsdl
WSDLToJava Error: org.apache.cxf.tools.common.toolspec.parser.BadUsageException: Unexpected argument: invoice_v1.wsdl
org.apache.cxf.tools.common.ToolException: org.apache.cxf.tools.common.toolspec.parser.BadUsageException: Unexpected argument: invoice_v1.wsdl
Set-Up in SOAPUI:
1. In SoapUI, go to Tools | Apache CXF, and when the Apache CXF Stubs window
appears, click on the Tools button to bring up the SoapUI Preferences window.
Here, browse to the location where you downloaded Apache CXF, select the bin
directory, and then click on OK:
2. Next, we need to configure the generation options under the Basic tab. The main
points are:
WSDL location: For example, <chapter1
samples>/soap/invoicev1/wsdl/invoice_v1.wsdl.
Output directory: This is where the generated source code will end up; for
example; <chapter1 samples>/soap/invoicev1/src/main/java.
Package Structure: This is for the generated source code; for example,
ws.invoice.v1.
Artifact Options: Only tick Server and Implementation. However, the client
and Ant build file options are also available. We will be using SoapUI as our
client and won’t require Ant.
3. To automatically compile our generated service code, under the Advanced tab, do the
following:
Tick Compile.
Supply a Class Folder value for the resulting Java class files, for example,
<chapter1 samples>/soap/invoicev1/target/classes.
Tick Validate WSDL (optional) under the advanced tab to check the structure
and get basic WS-I compliance checks on your WSDL. Note that the
invoice_v1.wsdl should not produce any output with this option.
Leave all other fields and checkboxes unchanged.
4. Under the Custom Args tab, enter –wsdlLocation invoice_v1.wsdl in Tool Args.
This tells the web service code where to look for the WSDL file at runtime. Setting
the value like this means that invoice_v1.wsdl is expected to be the root of the
classes directory. More on this in the next section.
5. Now, we are ready to click on Generate