jboss-fuse / wsdl2rest

A tool allowing quick migration from existing JAX-WS services to REST
Apache License 2.0
26 stars 22 forks source link

Separate locations for generated Camel and Java files #20

Closed bfitzpat closed 6 years ago

bfitzpat commented 6 years ago

Any chance we can add a command-line option that offers a specific location for the generated Camel XML file vs. the generated source? One single specified output path doesn't quite work when we're trying to put Java code in src/main/java for source and src/main/resources/OSGI-INF or src/main/resources/META-INF/spring for the Camel configuration.

tdiesler commented 6 years ago

I'd say the caller should move the generated output to wherever needed. Would this not work?

bfitzpat commented 6 years ago

We could definitely move it as an after-step, but it would be nice to have the option to have it generated in the correct location if specified.

tdiesler commented 6 years ago

How are you interfacing with the tool? If it is via cmd line options, I'd be reluctant to expose such a redundant option to the public. If it is via API, we could do this for your convenience.

bfitzpat commented 6 years ago

I am calling the tool in code, not via command line options. It would be great to have a convenience method I could call.

Wsdl2Rest tool = new Wsdl2Rest(wsdlLocation, outpath);
tool.setTargetContext(contextpath);
if (!Strings.isEmpty(options.getBeanClassName())) {
    tool.setTargetBean(options.getBeanClassName());
}
if (!Strings.isEmpty(options.getTargetServiceAddress())) {
    URL targetAddressURL = new URL(options.getTargetServiceAddress());
    tool.setTargetAddress(targetAddressURL);
}
tool.process();
tdiesler commented 6 years ago

ok, lets do this