1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| public static void main(String[] args) throws Exception {
try {
// Instance of axis2 stub ( generate with wsdl2 )
XmlSelectStub xss = new XmlSelectStub();
//Options of client service
Options options = xss._getServiceClient().getOptions();
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setPreemptiveAuthentication(true);
auth.setPassword(PASSWORD);
auth.setUsername(USER_NAME);
options.setProperty(HTTPConstants.AUTHENTICATE,auth);
// Definition of SubmitXml method (request,filter,profile)
com.galileo.webservices.SubmitXml Sbxml = new SubmitXml();
String toto = CreateRequest();
Request_type0 req = new Request_type0();
req.setExtraElement(AXIOMUtil.stringToOM(toto));
Sbxml.setRequest(req);
Filter_type0 flt = new Filter_type0();
flt.setExtraElement(AXIOMUtil.stringToOM("<_/>"));
Sbxml.setFilter(flt);
Sbxml.setProfile(APOLLO_HAP);
System.out.println(Sbxml.getProfile()+"\n"+Sbxml.getFilter().getExtraElement()+"\n"+Sbxml.getRequest().getExtraElement());
// Execution method SubmitXml
SubmitXmlResponse titi = xss.submitXml(Sbxml);
//System.out.println(subxres.toString());
}
catch (AxisFault axisFault) {
axisFault.printStackTrace();
}
catch (XMLStreamException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println(e.toString());
}
catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} |