views:

106

answers:

2

I need to incorporate a pretty complex 3rd party web service into my Grails app. My plan was to use WSDL2Java to generate the stub classes from the wsdl, and this was the method recommended in the 3rd party's documentation (complete with examples). First i tried to use the Axis2 codegen plugin for Eclipse but eventually came up against an InvocationTargetexception. I debugged the plugin and found it was because the wsdl is defined with RPC encoding.

Some people have recommended using Axis 1.4 instead, so I've now installed that too but have come up against an IO Exception - Type {http://xml.apache.org/xml-soap}DataHandler is referenced but not defined.

Can anyone suggest a method for creating the java classes from this wsdl without having to hack the wsdl apart?

A: 

Have you solved it??

I have the same problem right now !!

fran
A: 

I ended up using the Axis2 wdsl2java and copying the required annotated code into the service and used the CXF plugin. I also put in my service the following code

static expose=['cxfjax']

The reason why I had to do this was because there was a "complicated" (for grails) structure my methods look like

   @WebMethod(operationName = "authenticate", action = "http://betterhidethis/authenticate")
   @WebResult(name = "authenticateResult", targetNamespace = "http:/betterhidethis/")
   public ArrayOfString authenticate(
       @WebParam(name = "strUserName", targetNamespace = "http://betterhidethis/")
       String strUserName,
       @WebParam(name = "strPassword", targetNamespace = "http://betterhidethis/")
       String strPassword) { 

Of cause the Geneerator also created the ArrayOfString class which I use later.

Hope this helps.

Scott Warren