RajaneeshJM
Programmer
Hi,
I am new to OpenText LiveLink. We are using Content Server 10 SP2 Update 11. The Content Server has been installed on a machine [lets assume machine name as livelinkhost] using IIS. Also the Web Services have been deployed on the same machine using Tomcat. I am able to access the CS using the url Also I am able to access the WSDL using the url
To verify the webservices, I have written a sample Java program TestLiveLink.java [available in the attachment]. Also I have used the wsimport tool of JAX-WS [available in my local machine] to create a JAR file [livelink.jar]. While creating the JAR files I had copied the WSDL files from the server available in the path TOMCAT_HOME/webapps/les-services/WEB-INF/wsdl to a local path and used the below wsimport command
wsimport -keep -verbose E:\OpenText\WSDL\Authentication.wsdl -d E:\OpenText\WSDL\Build1_JAX-WS\classes -s E:\OpenText\WSDL\Build1_JAX-WS\src
livelink.jar created using the command jar -cvf livelink.jar *.*
As part of the IDE project [using IntelliJ] the below list of JAR files are associated to the project
activation-1.1.jar
FastInfoset.jar
http.jar
jaxb-api.jar
jaxb-impl.jar
jaxb-xjc.jar
jaxws-api.jar
jaxws-rt.jar
jaxws-tools.jar
jsr173_api.jar
jsr181-api.jar
jsr250-api.jar
livelink.jar
otjaxws.jar
resolver.jar
saaj-api.jar
saaj-impl.jar
sjsxp.jar
stax-ex.jar
streambuffer.jar
When I try to Run the TestLiveLink program I get the below error.
Exception in thread "main" com.sun.xml.ws.client.ClientTransportException: HTTP transport error: java.net.ConnectException: Connection refused: connect
at com.sun.xml.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:134)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:140)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:86)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
at com.sun.xml.ws.client.Stub.process(Stub.java:248)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:135)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
at $Proxy34.authenticateUser(Unknown Source)
at com.sysarris.register.livelink.TestLiveLink.getAuthenticationToken(TestLiveLink.java:66)
at com.sysarris.register.livelink.TestLiveLink.main(TestLiveLink.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at com.sun.xml.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:122)
... 19 more
Process finished with exit code 1
Please help me in solving the problem. I am new to WebServices and LiveLink
package com.sysarris.register.livelink;
import java.util.*;
import javax.xml.soap.*;
import javax.xml.namespace.QName;
import com.sun.xml.internal.ws.developer.WSBindingProvider;
import com.sun.xml.internal.ws.api.message.Header;
import com.sun.xml.internal.ws.api.message.Headers;
import com.opentext.livelink.service.core.*;
import com.opentext.livelink.service.docman.*;
import com.opentext.livelink.service.docman.Node;
import com.opentext.ecm.api.OTAuthentication;
public class TestLiveLink{
public static void main(String[] args){
String admToken = getAuthenticationToken("Admin", "livelink");
try{
DocumentManagement dm = getDMService(admToken);
System.out.println("Token: " + admToken);
//Confirm Admin Home
Node nPersonalWS = dm.getRootNode("PersonalWS");
System.out.println(nPersonalWS.getName());
}catch(Exception e){
e.printStackTrace();
}
}
private static DocumentManagement getDMService(String authToken) throws Exception{
DocumentManagement_Service service = new DocumentManagement_Service();
DocumentManagement endpoint = service.getBasicHttpBindingDocumentManagement();
OTAuthentication otAuth = new OTAuthentication();
otAuth.setAuthenticationToken(authToken);
setSoapHeader((WSBindingProvider) endpoint, otAuth);
return endpoint;
}
public static void setSoapHeader(WSBindingProvider bindingProvider, OTAuthentication otAuth) throws Exception{
List<Header> headers = new ArrayList<Header>();
SOAPMessage message = MessageFactory.newInstance().createMessage();
SOAPPart part = message.getSOAPPart();
SOAPEnvelope envelope = part.getEnvelope();
SOAPHeader header = envelope.getHeader();
headers.add(getOTAuthenticationHeader(header, otAuth));
bindingProvider.setOutboundHeaders(headers);
}
public static Header getOTAuthenticationHeader(SOAPHeader header, OTAuthentication otAuth) throws Exception{
SOAPHeaderElement otAuthElement;
SOAPElement authTokenElement;
otAuthElement = header.addHeaderElement(new QName("urn:api.ecm.opentext.com", "OTAuthentication"));
otAuthElement.setPrefix("");
authTokenElement = otAuthElement.addChildElement(new QName("urn:api.ecm.opentext.com", "AuthenticationToken"));
authTokenElement.setPrefix( "" );
authTokenElement.addTextNode(otAuth.getAuthenticationToken());
return Headers.create(otAuthElement);
}
private static String getAuthenticationToken(String userName, String password) {
String token;
Authentication endpoint;
Authentication_Service service = new Authentication_Service();
endpoint = service.getBasicHttpBindingAuthentication();
token = endpoint.authenticateUser(userName, password);
return token;
}
}
Regards
Rajaneesh JM
I am new to OpenText LiveLink. We are using Content Server 10 SP2 Update 11. The Content Server has been installed on a machine [lets assume machine name as livelinkhost] using IIS. Also the Web Services have been deployed on the same machine using Tomcat. I am able to access the CS using the url Also I am able to access the WSDL using the url
To verify the webservices, I have written a sample Java program TestLiveLink.java [available in the attachment]. Also I have used the wsimport tool of JAX-WS [available in my local machine] to create a JAR file [livelink.jar]. While creating the JAR files I had copied the WSDL files from the server available in the path TOMCAT_HOME/webapps/les-services/WEB-INF/wsdl to a local path and used the below wsimport command
wsimport -keep -verbose E:\OpenText\WSDL\Authentication.wsdl -d E:\OpenText\WSDL\Build1_JAX-WS\classes -s E:\OpenText\WSDL\Build1_JAX-WS\src
livelink.jar created using the command jar -cvf livelink.jar *.*
As part of the IDE project [using IntelliJ] the below list of JAR files are associated to the project
activation-1.1.jar
FastInfoset.jar
http.jar
jaxb-api.jar
jaxb-impl.jar
jaxb-xjc.jar
jaxws-api.jar
jaxws-rt.jar
jaxws-tools.jar
jsr173_api.jar
jsr181-api.jar
jsr250-api.jar
livelink.jar
otjaxws.jar
resolver.jar
saaj-api.jar
saaj-impl.jar
sjsxp.jar
stax-ex.jar
streambuffer.jar
When I try to Run the TestLiveLink program I get the below error.
Exception in thread "main" com.sun.xml.ws.client.ClientTransportException: HTTP transport error: java.net.ConnectException: Connection refused: connect
at com.sun.xml.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:134)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:140)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:86)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
at com.sun.xml.ws.client.Stub.process(Stub.java:248)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:135)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
at $Proxy34.authenticateUser(Unknown Source)
at com.sysarris.register.livelink.TestLiveLink.getAuthenticationToken(TestLiveLink.java:66)
at com.sysarris.register.livelink.TestLiveLink.main(TestLiveLink.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at com.sun.xml.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:122)
... 19 more
Process finished with exit code 1
Please help me in solving the problem. I am new to WebServices and LiveLink
package com.sysarris.register.livelink;
import java.util.*;
import javax.xml.soap.*;
import javax.xml.namespace.QName;
import com.sun.xml.internal.ws.developer.WSBindingProvider;
import com.sun.xml.internal.ws.api.message.Header;
import com.sun.xml.internal.ws.api.message.Headers;
import com.opentext.livelink.service.core.*;
import com.opentext.livelink.service.docman.*;
import com.opentext.livelink.service.docman.Node;
import com.opentext.ecm.api.OTAuthentication;
public class TestLiveLink{
public static void main(String[] args){
String admToken = getAuthenticationToken("Admin", "livelink");
try{
DocumentManagement dm = getDMService(admToken);
System.out.println("Token: " + admToken);
//Confirm Admin Home
Node nPersonalWS = dm.getRootNode("PersonalWS");
System.out.println(nPersonalWS.getName());
}catch(Exception e){
e.printStackTrace();
}
}
private static DocumentManagement getDMService(String authToken) throws Exception{
DocumentManagement_Service service = new DocumentManagement_Service();
DocumentManagement endpoint = service.getBasicHttpBindingDocumentManagement();
OTAuthentication otAuth = new OTAuthentication();
otAuth.setAuthenticationToken(authToken);
setSoapHeader((WSBindingProvider) endpoint, otAuth);
return endpoint;
}
public static void setSoapHeader(WSBindingProvider bindingProvider, OTAuthentication otAuth) throws Exception{
List<Header> headers = new ArrayList<Header>();
SOAPMessage message = MessageFactory.newInstance().createMessage();
SOAPPart part = message.getSOAPPart();
SOAPEnvelope envelope = part.getEnvelope();
SOAPHeader header = envelope.getHeader();
headers.add(getOTAuthenticationHeader(header, otAuth));
bindingProvider.setOutboundHeaders(headers);
}
public static Header getOTAuthenticationHeader(SOAPHeader header, OTAuthentication otAuth) throws Exception{
SOAPHeaderElement otAuthElement;
SOAPElement authTokenElement;
otAuthElement = header.addHeaderElement(new QName("urn:api.ecm.opentext.com", "OTAuthentication"));
otAuthElement.setPrefix("");
authTokenElement = otAuthElement.addChildElement(new QName("urn:api.ecm.opentext.com", "AuthenticationToken"));
authTokenElement.setPrefix( "" );
authTokenElement.addTextNode(otAuth.getAuthenticationToken());
return Headers.create(otAuthElement);
}
private static String getAuthenticationToken(String userName, String password) {
String token;
Authentication endpoint;
Authentication_Service service = new Authentication_Service();
endpoint = service.getBasicHttpBindingAuthentication();
token = endpoint.authenticateUser(userName, password);
return token;
}
}
Regards
Rajaneesh JM