Cisco Cisco 3350 Mobility Services Engine Guide Du Développeur

Page de 224
                   
C
ISCO 
MSE
 
API
 
S
PECI FICATI ON 
G
UIDE 
 
C
ONTEXT 
A
W ARE 
S
ERVICE OF 
MSE,
 
R
EL EASE 
7.4
.
                                   
P
A G E  
214
  O F  
227  
 
13.3  Java and c# Samples 
13.3.1 
WSDL to Java  
WSDL can be converted to Java using WSDL2Java axis tool. Download the Axis2 at 
http://ws.apache.org/axis2/download.cgi 
13.3.2 
WSDL to java using Command Line
 
 
Set Classpath to all the libraries of Axis2.  
 
Use the following command on the prompt. 
java  -classpath  %AXIS2%  org.apache.axis2.wsdl.WSDL2Java    -o  c:\output  -l  java  -d 
xmlbeans -uri c:/wsdl/mse-location.wsdl
 
Note
xmlbeans option is must. Other databinding may fail. 
Also Check the WSDL uri and xsd uri are in right path. 
This will generate stub and skeleton code in addition to the normal methods in the WSDL. We 
can use this stub code to connect to the server and get the server response. 
NoteThere will be two wsdl’s mse-aaa.wsdl contains Login/Logout calls and mse-location.wsdl 
contains all location calls. So you need to convert both these wsdls to java class and then call the 
API. Please refer the sample java client for the usage
13.3.3 
Axis2 Java Client 
 
Steps for writing the client Program to test the web service. 
1)  Create an object for the Stub Class generated passing the URL of the service as 
argument. 
2)  We need to get the SSL certificate from the server and save it in local machine and then 
need to set this certificate in the properties while making web service call. This step is 
necessary. Use the InstalCert program, get the Certification, store it in local machine and 
give the path in the System.SetProperties statement in the sample after each stub call. 
3)  Use the method you want to operate on. The stub file generated contains all method 
names and parameters to pass in and the return element output. 
4)  Call the method using the object of the stub class.