The following document serves as a way to introduce users to the CXF SOAP web service by usage of the built in sample packages. We will describe how to obtain and configure the packages in order to successfully compile and run a sample CXF program. Such content may assist developers who wish to review a working Java sample code package for use in their own development activities.
The sample that is being used is NX_ROOT\samples\sdk\cxfwebsvc\java\test3_attachments, file create_attachment.java.
Execution of the create_attachment.java sample will entail running the following three methods defined in CXF Web Services:
Release: 17.4 GA and above
CA Service Desk Manager
The following should be performed on a non-production based Service Desk Server instance which has access to the CXF web services via the following URL from the web browser situated on the SDM Server:
http://localhost:8080/cxf/services/USD_WebService?wsdl
The following is a sample output indicating a successful run, where Request case 50 was created, and file test_upload_file.txt is attached to the ticket under the default doc repository.
C:\java-cxf-sample>run_java_test.bat
Generating the CA Service Desk Web Services stub files with WSDL2Java
Compiling the CA Service Desk Web Services stub files
error: no source files
Compiling create_attachment.java
warning: Implicitly compiled files were not subject to annotation processing.
Use -proc:none to disable annotation processing or -implicit to specify a policy for implicit compilation.
1 warning
Running create_attachment
Mar 05, 2026 9:27:54 PM org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL
INFO: Creating Service {http://www.ca.com/UnicenterServicePlus/ServiceDesk}USD_WebService from WSDL: http://localhost:8080/cxf/services/USD_WebService?wsdl
SID: 2080203109
Handle for 'ServiceDesk' is: cnt:XXXX
Creating a Request...
Created Request: 50, Handle: cr:400001
Successfully uploaded the file to the Request, attachment handle: attmnt:400053
C:\java-cxf-sample>
The above instructions and the associated sample code is provided as-is. Support is not permitted to assist in modifying the above code to provide further functionality.
There is an Axis SOAP equivalent of the create_attachment.java file located in NX_ROOT\samples\sdk\websvc\java\test3_attachments, which can be used to compare the two implementations of SOAP web services, in conjunction with existing documentation for CXF Migration for CA SDM. Please be aware that Axis Web Services has been deprecated as of June 30, 2025.
For SDM 17.4 RU5 and above, Axis web services is removed entirely. The Axis samples may not be available after this RU release.
Ideally, the SDM Server should be a non-production instance without customisations or changes introduced. This is due to the sample code having been written for a baseline instance of Service Desk and will not have awareness of any customisations that were introduced, such as additional required fields when creating a ticket, or the default document repository being disabled. It is also not possible to run the above sample code remotely from the SDM Server as the code requires access to certain jar files that exist in the SDM install itself.
The version of CXF binary distributable needed to run the java samples should be 3.6.x. Later versions of Apache CXF, from 4.x onward, lack support for the Java implementation certified for Service Desk, and also lack certain javax packages that are needed to compile the java samples successfully. These include javax.activation, javax.jws.soap, and javax.xml.ws.
Attempting to compile the java samples in such cases (later Java implementations or Apache CXF binaries) may result in compilation errors such as:
CreateAttachment.java:111: error: package javax.activation does not exist