AnsweredAssumed Answered

Need help on implementation methods in java to extract data from ca clarity

Question asked by snaptest on Jan 31, 2013
Latest reply on Jan 31, 2013 by Dave
Hi everyone,


I am able to get response from the following Java Code. And able to find session id in the response. But, then i want the procedure to get / write data from/to the ca clarity ppm endpoint.
Please help me, i am stuck. I dont know the procedure to extract data from ca clarity.

SOAPConnectionFactory factory = SOAPConnectionFactory.newInstance();



SOAPConnection connection = factory.createConnection();



MessageFactory messageFactory = MessageFactory.newInstance();

SOAPMessage message = messageFactory.createMessage();

SOAPPart soapPart = message.getSOAPPart();

SOAPEnvelope envelope = soapPart.getEnvelope();

SOAPHeader header = envelope.getHeader();

SOAPBody body = envelope.getBody();



envelope.addNamespaceDeclaration("xog", "http://www.niku.com/xog");

envelope.addNamespaceDeclaration("xmlns","http://schemas.xmlsoap.org/soap/envelope/");



Name bodyName = envelope.createName("xog:Login");

SOAPBodyElement bodyElement = body.addBodyElement(bodyName);



Name userName = envelope.createName("Username","xog","http://www.niku.com/xog");

SOAPElement userNameElement = bodyElement.addChildElement(userName);

userNameElement.addTextNode("****");



Name password = envelope.createName("Password","xog","http://www.niku.com/xog");

SOAPElement passwordElement = bodyElement.addChildElement(password);

passwordElement.addTextNode("****");





message.writeTo(System.out);

System.out.println();



URL endpoint = new URL("");//end point url needs to give

SOAPMessage response = connection.call(message, endpoint);

System.out.println(response.toString());



Thanks,
Satya

Outcomes