Skip to main content

Import is a reserved word in Java error when importing the KIC WSDL into custom Java KIC Web Service client


QAID # 19736 Published 

Question / Problem:

I am creating a Java Web Service client for Kofax Import Connector - Web Services, (KIC-WS).

When attempting to import the WSDL file included with the KIC package, an error occurs stating that "Import" is a reserved word in Java:

C:\Jars>wsimport -keep -verbose wsclient.jar mywsdl.wsdl parsing WSDL...
[ERROR] Invalid operation "Import", it's java reserved word, can't generate java
method. Use customization to change the operation name.
line 331 of file:/C:/Jars/mywsdl.wsdl

Answer / Solution:

To generate the client JAR files:

wsimport -keep http:/localhost:25086/file/import?wsdl -b Binding.xml

Contents of Binding.xml:

    xmlns:jaxws="" xmlns:wsdl="">
        <jaxws:method name="ImportToKofaxCapture" />

The signature of the Import call changes in the Java client. Note below the difference between the C# and Java versions:

  • C#
    • ImportResponse resp = <object of type importService>.Import(<object of type Import>);
  • Java
    • ImportResponse resp = <object of type ImportPortType>.ImportToKofaxCapture(<object of type Import, empty byte array (byte[])>);

Applies to:

Product Version
KIC 2.3