Forum Discussion

lkremer's avatar
lkremer
Occasional Contributor
12 years ago

Web services sample code fails

Hi, I'm about to create a web service and started with the official sample code: http://support.smartbear.com/viewarticle/25688/



It fails at the fourth line:



CodeCollaborator client = (CodeCollaborator) factory.create();



It throws a NullPointerException:


java.lang.NullPointerException
at java.lang.Class.isAssignableFrom(Native Method)
at org.apache.cxf.jaxws.support.JaxWsServiceConfiguration.isWebMethod(JaxWsServiceConfiguration.java:166)


Has anyone managed to compile the sample code?



Are there other examples which could be guideline for the first steps?



Thanks!
  • lkremer's avatar
    lkremer
    Occasional Contributor
    Solved!



    First I generated the classes with wsdl2java, but there were errors, so I tried to add the web service with Eclipse. It aslo generated the classes, and with that there were no errors in the sample with the exceptions thrown. 



    Now I re-generated the classes with wsdl2java and they differ from the ones which were created by Eclipe. Then I fixed the exception type problems, and now it runs!