SICS 4.9.5

SICS 4.9.5

SE-1424 #

Background #

In SE-1424, SICS API Server was upgraded from using Apache Axis 1.4 SOAP stack to its successor: Apache Axis2 Web services engine due to multiple high-risk security vulnerabilities in the Apache Axis 1.4 SOAP stack.

SOAP encoding has been deprecated and is no longer supported by Apache Axis2.

SICS API Server with Unrestricted (%NONE%), Axis or .NET Framework (DotNet) compatible WSDL/XSD files was previously using the RPC/encoded style but is now changed to use the RPC/literal style.

XSD/WSDL files that was using the RPC/encoded style was in violation with the Basic Profile 1.1 R2110, R2111 and R2113 in relation to the definitions of array types. Since RPC/encoded XSD/WSDL files has been changed to RPC/literal, all incorrect array type definitions have been corrected.

Note that the Axis 1 generated stubs for SICS API Server are now deprecated!

Migrating from Axis 1 to Axis 2 clients for SICS API Server #

Let’s look at a simple example where the about is called on SicsWsAdministrationEntryPoint from the API Client

Axis 1

SicsWsAdministrationEntryPointPort sicsWsAdministrationEntryPointPort = new SicsWsAdministrationEntryPointLocator()
    .getSicsWsAdministrationEntryPointPort(new URL("http://localhost:8080/SicsServer/SicsWSServlet"));
ServerInformation serverInformation = sicsWsAdministrationEntryPointPort.about();

Axis 2

SicsWsAdministrationEntryPointStub sicsWsAdministrationEntryPointStub = new SicsWsAdministrationEntryPointStub("http://localhost:8080/SicsServer/SicsWSServlet");
About aboutRequest = new About();
aboutRequest.setAbout(new AboutInput());
AboutResponse result = sicsWsAdministrationEntryPointStub.about(aboutRequest);
AboutOutput aboutResponse = result.getAboutResponse();
ServerInformation serverInformation = aboutResponse.getServerInformation();

The Axis2 service invocations deal with the SOAP Body element itself. The “aboutRequest” variable above contains the SOAP Body element which will go in the SOAP Envelope. Once the about service is called by the client stub, the “aboutRequest” will bound according to the Axis2 Data Binding (ADB) framework. So extra work of parsing the “aboutRequest” will vanish.

Non-blocking (Asynchronous) service invocation is also supported by the Axis2 clients. In a non-blocking invocation, the client proceeds to the next step immediately and the response (if any) are handled using a callback mechanism.

SicsWsAdministrationEntryPointStub sicsWsAdministrationEntryPointStub = new SicsWsAdministrationEntryPointStub("http://localhost:8080/SicsServer/SicsWSServlet");
About aboutRequest = new About();
aboutRequest.setAbout(new AboutInput());
sicsWsAdministrationEntryPointStub.startabout(aboutRequest, new SicsWsAdministrationEntryPointCallbackHandler() {
  @Override
  public void receiveResultabout(AboutResponse result) {
    AboutOutput aboutResponse = result.getAboutResponse();
    ServerInformation serverInformation = aboutResponse.getServerInformation();
  }
});

Axis2 is capable of handling megabytes of requests and responses, well above the capabilities of Axis1.4.

Migrating from RPC/encoded to RPC/literal using the deprecated Axis 1 clients for SICS API Server #

The Axis 1 generated stubs have minor changes in relation to the array types, the array type wrapper classes have been removed.

In the examples below, you can see that the chainedOperations method was returning a wrapper class for all the chained operation responses and also accepting a wrapper class for all the chained operation requests when using the RPC/encoded style. To migrate, simply remove all references to the old array wrapper classes.

Axis1 client (RPC/encoded)

SicsWsAdministrationEntryPointPort sicsWsAdministrationEntryPointPort = new SicsWsAdministrationEntryPointLocator()
    .getSicsWsAdministrationEntryPointPort(new URL("http://localhost:8080/SicsServer/SicsWSServlet"));
ChainedOperationResponses chainedOperationResponses = sicsWsAdministrationEntryPointPort.chainedOperations(new SicsGenericInput(),
    new ChainedOperationRequests(new ChainedOperationRequest[] { new ChainedOperationRequest("1", null, new AboutRequest(new AboutInput())) }));
ServerInformation serverInformation = ((AboutResult) chainedOperationResponses.getChainedOperation()[0].getResponse()).getAboutOut().getServerInformation();

To migrate your code using the deprecated Axis 1 client stubs, you simply remove all references to the old array wrapper classes as shown below.

Axis1 client (RPC/literal)

SicsWsAdministrationEntryPointPort sicsWsAdministrationEntryPointPort = new SicsWsAdministrationEntryPointLocator()
    .getSicsWsAdministrationEntryPointPort(new URL("http://localhost:8080/SicsServer/SicsWSServlet"));
ChainedOperationResponse[] chainedOperationResponses = sicsWsAdministrationEntryPointPort.chainedOperations(new SicsGenericInput(),
    new ChainedOperationRequest[] { new ChainedOperationRequest("1", null, new AboutRequest(new AboutInput())) });
ServerInformation serverInformation = ((AboutResult) chainedOperationResponses[0].getResponse()).getAboutOut().getServerInformation();