Friday, February 27, 2009

Mount SSH/SFTP drive in Windows, take 2

Remember my last rant about how difficult it is to mount remote drives in MS Windows environment?

Well, now it seems that there actually is a way to get FUSE functionality and SSHFS in Windows. There is a project called Dokan.

Take a look here: http://dokan-dev.net/en/about/
Download here: http://dokan-dev.net/en/download/

Haven't tried it out myself yet, though.

Monday, January 5, 2009

Generating Java clients from WCF web service, trouble with JAXBElement

If you are generating a Java client from WCF service WSDL the result is usually a lot of JAXBElement types instead of simple or complex types defined in the service schema.

While there is nothing wrong with that result, you may want to get rid of most or all of JAXBElements and thus make your code smaller, cleaner and easier to use.

The first solution might seem to be using <xjc:simple/> configuration as shown in http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html.
It is usually not the case with WCF services and so the <xjc:simple/> method does not help.

The actual solution is found in https://jax-ws.dev.java.net/guide/Customizations_for_WCF_Service_WSDL.html.

Just use generateElementProperty="false".

Quote from the solution:
When processing a WCF service WSDL, it is recommended that the generateElementProperty customization be set to false in <jaxb:globalBindings>


The generateElementProperty attribute was introduced in JAXB 2.1.