I know very little about Java, but have had the misfortune to be tasked with writing an extract program to get some data from a server via its API. The problem I'm having is understanding the instructions required to connect to the API and there's not much assistance available.
The instructions I have been given are:
Can someone interpret what this actually means in terms of practical steps ? I have a feeling it was written more for a Windows-based application, but I'm trying to do this on a UNIX (Sun) server.
What do I actually need to do to create my JAR file ? Do I just put the XML and the java code in the JAR file and it all just magically works, or is there a bit more to it ?
The instructions I have been given are:
Code:
Web Service client using Java
This document outlines the necessary steps required to invoke a jets web service using Java.
1. Create a Client jar. Use clientgen task in your buildfile to create webservice client jar
Copy the wsdl you are using to query DQS in build.xml file:
<target name="generate-client">
<clientgen wsdl="[URL unfurl="true"]http://xxx.xxx.xxx/DQS/DQService?WSDL"[/URL] packageName="dqsws" clientJar="DQSClient.jar">
<classpath refid="project.class.path"/>
</clientgen>
</target>
3. Add this jar to your class path.This client jar will contain the implementation class to invoke the webservice.
4. The client class will use the implementation created as follows:
public class Client
{
public static void main (String a[])
{
DQService_Impl implementation=null;
try
{
implementation = new DQService_Impl("[URL unfurl="true"]http://xxx.xxx.xxx/DQS/DQService?WSDL");[/URL]
} catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
DQServicePort service = implementation.getDQServicePort();
String output = service.getDataDictionary(arg0, arg1, arg2, arg3, arg4, arg5);
}
}
Can someone interpret what this actually means in terms of practical steps ? I have a feeling it was written more for a Windows-based application, but I'm trying to do this on a UNIX (Sun) server.
What do I actually need to do to create my JAR file ? Do I just put the XML and the java code in the JAR file and it all just magically works, or is there a bit more to it ?