This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See thread...

We are using Axis2 to expose existing java code as web services. We are using the WSDL created automatically by the web app.

We are having a problem calling any method which exposes a parameter which contains objects with interface reference variables. eg.

- PostCodeConcrete implements PostCodeInterface
- Address Object contains a member variable of PostCodeInterface declared as PostCodeInterface p = new PostCodeConcrete();
- Another class exposes a method whose signature contains Address; eg. getPersonFromAddress( Address a ) on which the WSDL is based.

The client call to the webservice works fine from a JUnit test client. But when I try to test from a client I get an "java.lang.Instantiationexception". The code works from when I remove the interface reference variables, but as our code is existing, I would rather not re-write the entire system.

I ran the soapmonitor applet and the difference in the soap message is that the java client passes in a concrete type attribute for the parameter, so even though an interface is passed the SOAP message is telling Axis2 what concrete class to instantiate. does not pass in a type parameter, and I guess Axis2 is trying to instantiate an interface, hence the exception.

We would like to implement webservices to expose our java code to our code, but this is causing us a headache. As the major benefit of web services is platform interoperability, I am sure that the solution must be really simple.

Thanks in advance for any help.
Enjoy the full beauty of the english language. Embedded in this tiny ad:
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!