cancel
Showing results for 
Search instead for 
Did you mean: 

SDM API ? .

Former Member
0 Kudos

Is there a official SDM API which could be used for deployment e.g. in own installation programs available ? I know that in the SDM folder several SDM libraries can be found - but can they be used to create such an installer ? Any info appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

stanimir_dochev
Explorer
0 Kudos

Hello Frederic,

We do not provide an official SDM API.

If you want to work directly with SDM in the current NetWeaver release you can only use the SDM GUI as described in the <i>Software Deployment Manager</i> documentation (http://help.sap.com/saphelp_nw04/helpdata/en/22/a7663bb3808c1fe10000000a114084/frameset.htm).

In case you need to automate your procedures which is probably your case, consult with <i>Working with the SAP NetWeaver Java Development Infrastructure</i> (http://help.sap.com/saphelp_nw04/helpdata/en/03/f6bc3d42f46c33e10000000a11405a/frameset.htm).

Kind regards,

Stanimir

Answers (1)

Answers (1)

Former Member
0 Kudos

I am not sure why SAP is so reluctant to show how to use the SDM API. I have created an ANT Task that can deploy via the SDM API. Here is a codesnippet:

File archive = new File("C:/temp/my.ear");

String host = "myserver";

int port = "500018";

String password = "secret";

log("Deploying on server:" + host + ":" + port + " file:" + archive + " ...", 2);

ClientSession session = null;

try

{

session = ClientSessionFactory.createRemoteClientSession(port, host, password);

Client client = session.getClient();

DeployItem item = client.getHelperFactory().createDeployItem(archive);

DeployProcessor deployer = client.getDeployProcessor();

deployer.setComponentVersionHandlingRule(client.getHelperFactory().createComponentVersionHandlingRule(0));

deployer.deploy(new DeployItem[] {

item

});

DeployResult result = item.getDeployResult();

com.sap.sdm.api.remote.deployresults.DeployResultType type = result.getType();

String text = result.getResultText();

log("Deployed!", 2);

log("ResultText:" + text + " " + type.getClass(), 2);

}

catch(IOException ioe)

{

ioe.printStackTrace();

log("Error in deployment" + ioe, 0);

}

catch(RemoteException e)

{

e.printStackTrace();

log("Error in deployment" + e, 0);

}

finally

{

if(session != null)

try

{

session.closeSession();

}

catch(RemoteException e1)

{

e1.printStackTrace();

}

}