1 19 package org.openharmonise.webdav.client.webservice; 20 21 import java.net.MalformedURLException ; 22 import java.net.URL ; 23 import java.rmi.RemoteException ; 24 25 import javax.xml.namespace.QName ; 26 import javax.xml.rpc.ServiceException ; 27 28 import org.apache.axis.client.Call; 29 import org.apache.axis.client.Service; 30 31 38 public class UserDetailsService { 39 public static final String SIMULACRA_WEBSERVICE_NAMESPACE_URI = 40 "http://webservice.server.dav.openharmonise.org"; 41 42 45 public UserDetailsService() { 46 super(); 47 } 48 49 58 public static String getUserPath( 59 URL endpoint, 60 String sUserName) 61 throws java.rmi.RemoteException , ServiceException { 62 63 Service service = new Service(); 64 Call call = (Call) service.createCall(); 65 66 call.setTargetEndpointAddress(endpoint); 67 call.setOperationName( 68 new QName (SIMULACRA_WEBSERVICE_NAMESPACE_URI, "getUserPath")); 69 70 call.addParameter( 71 "sUserName", 72 org.apache.axis.Constants.XSD_STRING, 73 javax.xml.rpc.ParameterMode.IN); 74 75 call.setReturnType(org.apache.axis.Constants.XSD_STRING); 76 call.setReturnClass(String .class); 77 78 String ret = 79 (String ) call.invoke( 80 new Object [] { 81 sUserName}); 82 83 return ret; 84 } 85 86 public static void main(String [] args) { 87 URL endPointURL = null; 88 try { 89 90 endPointURL = new URL ("http://localhost:7000/webdav/services/DAVService"); 91 92 String sPath = UserDetailsService.getUserPath(endPointURL, "guest"); 93 } catch (RemoteException e) { 94 e.printStackTrace(); 95 } catch (ServiceException e) { 96 e.printStackTrace(); 97 } catch (MalformedURLException e) { 98 e.printStackTrace(); 99 } 100 } 101 102 } 103 | Popular Tags |