To get the Java proxy client up and running, generate a proxy (Java XmlBeans is recommended as a proxy generator), connect as the current user or a specific other user, and test the connection.
Procedure
- Generate the proxy by running the following command (on a single line):
"AXISROOT\bin\wsdl2java" -uri http://MYSERVER/webservices/CoreService2011.svc?wsdl -d xmlbeans -s -pn basicHttp -o C:\Temp
where AXISROOT refers to the root folder of your Apache Axis installation (for example, C:\Program Files\axis2-1.5.4\) and MYSERVER refers to the server on which the Core Service is running.
If you are using the SDL Tridion 2011-compatible endpoints, replace CoreService2011.svc with CoreService.svc.
Note: For forward compatibility reasons, SDL recommends using Java XmlBeans data binding.
- Add the following import statements to your proxy client class:
import org.w3c.dom.*;
import com.sdltridion.contentmanager.coreservice.*;
import com.sdltridion.contentmanager.r6.*;
- Connect to the Core Service as the user currently logged on to the system by connecting to the server and initializing the Core Service by writing the following code:
CoreService service = new CoreService();
ICoreService endpoint = service.getBasicHttp();