Home > Constructing SOAP with Apache Axis and WSS4J > Generating and Building the Stubs


Generating and Building the Stubs

  1. From each of the following packages, add these items to your classpath:
    • The current directory (.)
    • These files:
    Package Files
    Apache Axis
    • axis.jar
    • commons-discovery-0.2.jar
    • commons-logging-1.0.4.jar
    • jaxrpc.jar
    • log4j-1.2.8.jar
    • saaj.jar
    • wsdl4j-1.5.1.jar
    Apache WSS4J wss4j-1.5.1.jar
    Apache XML Security xmlsec-1.4.0.jar
    JDK JavaBeans Activation Framework activation.jar
    JDK Java Mail mail.jar
  2. From a command prompt, go to the directory in which you downloaded the CyberSource sample code Sample.java.
  3. To generate the stubs, execute this command without line breaks:

    java org.apache.axis.wsdl.WSDL2Java -p com.cybersource.stub

    https://ics2wstesta.ic3.com/commerce/1.x/transactionProcessor/

    CyberSourceTransaction_N.NN.wsdl

    where:

    >> com.cybersource.stub is the package name that will be used for the generated classes. You can choose a different package name if you wish. However, the rest of the steps and the sample code refer to this value.

    >> N.NN is the CyberSource API version. Find the latest version from https://ics2wstesta.ic3.com/commerce/1.x/transactionProcessor

  4. To compile the source code, execute this command:

    javac com/cybersource/stub/*.java

  5. Create a jar file by using the compiled classes:

    jar cf cybersource.jar com/cybersource/stub/*.class

  6. Add the newly created cybersource.jar file to your classpath.