Tuesday, April 21, 2009

Oracle to buy Sun Microsystems

It is a hot news that Oracle and Sun announced that Oracle to buy Sun on 2009-04-20.

http://www.sun.com/aboutsun/media/presskits/2009-0420/index.jsp

Tuesday, April 7, 2009

Java Object Clone Sample Code

To create a deep copy of Java object you should implement "Cloneable" interface and override clone() method. Here is the sample code:

class MyClass implements Cloneable
{
public Object clone()
{
try
{
return super.clone();
}
catch(CloneNotSupportedException ex)
{
return null;
}
}
}

Thursday, April 2, 2009

Accessing SAP XI Web Service through simple Axis 1 client

This a code for accessing SAP XI Web Service through Axis1, One can suggest Axis2 code for this.

Service service = new Service();
Call call = (Call) service.createCall();
call.setUseSOAPAction(true);
call.setSOAPActionURI("http://sap.com/xi/WebService/soap1.1");
call.setEncodingStyle(null);
call.setOperationName("YOUR_OPERATION_NAME_IN_WSDL");

Options opts = new Options(args);
args = opts.getRemainingArgs();
if (args != null) {
opts.setDefaultURL(args[0]);
} else {
opts.setDefaultURL("YOUR_SERVICE_URL_IN_WSDL");
}
//if athonticated service set
call.setUsername("YOUR_USERNAME");
call.setPassword("YOUR_PASSWORD");

call.setTargetEndpointAddress(new URL(opts.getURL()));

//requestString is soap envelope as a string
SOAPEnvelope env = new SOAPEnvelope(new ByteArrayInputStream(requestString.getBytes()));

call.invoke(env);

Search