Thursday, June 21, 2007

Getting webservices working in Curam development

Doing webservices in Curam is quite easy now that they are using Axis 1.2 which can parse more WSDL files. It is not the latest yet, but so far the WSDLs that are generated for a .Net environment do work in Java. I never bothered with the .cat file generation, I don't think it works too well especially with complex WSDLs. Fortunately, we do not need them. As per the DocCenter, you just need to copy the WSDL files into the wsdl folder in custom and reference them in webservices_config.xml. When you do build generated, it will eventually create a wsc-proxy.jar file for you. The problem is that the generated Java files are not put into the .classpath. To fix this, add <classpathentry kind="lib" path="build/svr/wsc/jav" sourcepath="build/svr/wsc/jav"/> to your .classpath. Do not add wsc-proxy.jar as Eclipse (with CheckStyle) might lock it and you cannot build without quitting Eclipse first. Now if you have an issue where you have two classes with the same name but in different packages or namespaces then you'd have a problem. Curam OOTB forces the package to "wsconnector" though I am not sure why yet. To fix this, you need to change CuramSDEJ\bin\wsdl2java.xsl and comment out the following line <xsl:attribute name="package">wsconnector</xsl:attribute> That should fix that problem. Until you try to do a build on CruiseControl. CruiseControl uses Ant which normally does not actually change your OS directory. So where in it tries to figure out where the NStoPkg.properties file is it might not find it. To fix this open up app_wsconnector.xml and add the bolded text to the following code snippet name="wsdl2java" classname="curam.util.tools.wsdl.WsdlToJavaAntTask" classpath="${jar.tools}:${jar.axis}:${jar.wsdl4j}: ${jar.jaxrpc}:${jar.commonslogging}:${jar.commonsdiscovery}: ${jar.saaj}:${jar.j2ee}:${SERVER_DIR}" ${basedir} will actually point to EJBServer during the CruiseControl build.

0 comments: