Hello, I am developing a Java Implementation to call Milestone Management Server Protocol Integration API, but It is throwing the error from the title.
I created all the Java classes from the WSDL link, then i call the end point like this
String endpoint = String.format("%s/ManagementServer/ServerCommandService.svc?wsdl", host);
HttpsURLConnection.setDefaultHostnameVerifier((hostname, session) -> true);
ClassLoader classLoader = getClass().getClassLoader();
URL url = classLoader.getResource("ServerCommandService.svc.wsdl");
ServerCommandService service = new ServerCommandService(url);
IServerCommandService iServer = service.getBasicHttpBindingIServerCommandService();
BindingProvider bp = (BindingProvider) iServer;
Map<String, Object> map = bp.getRequestContext();
map.put(BindingProvider.ENDPOINT\_ADDRESS\_PROPERTY, HTTPS + endpoint);
map.put(BindingProvider.USERNAME\_PROPERTY, user);
map.put(BindingProvider.PASSWORD\_PROPERTY, pass);
if (iServer != null) {
ObjectFactory factory = new ObjectFactory();
ConfigurationItem item = new ConfigurationItem();
setItemAttributes(item, factory, "Add new basic user", "AddBasicUser", "/", "/BasicUserFolder");
// Reuse the property object by resetting its fields for each new property
Property prop = new Property();
// ID Property
setPropertyAttributes(prop, "ID", "Id", 100, "00000000-0000-0000-0000-000000000000", "String", factory, false, "PropertyGeneralId", 1);
item.getProperties().getValue().getProperty().add(prop);
// Name Property
prop = new Property(); // Create a new Property object to avoid reference issues
setPropertyAttributes(prop, "Name", "Name", 100, user.getUserName(), "String", factory, true, "PropertyGeneralName", 2);
item.getProperties().getValue().getProperty().add(prop);
// Description Property
prop = new Property(); // Create a new Property object to avoid reference issues
setPropertyAttributes(prop, "Description", "Description", 100, user.getDescription(), "String", factory, true, "PropertyGeneralDescription", 0);
item.getProperties().getValue().getProperty().add(prop);
// Can Change Password Property
prop = new Property(); // Create a new Property object to avoid reference issues
setPropertyAttributes(prop, "Can change password", "CanChangePassword", 100, "True", "Tick", factory, false, "PropertyBasicUserCanChangePassword", 1);
item.getProperties().getValue().getProperty().add(prop);
// Password Property
prop = new Property(); // Create a new Property object to avoid reference issues
setPropertyAttributes(prop, "Password", "Password", 100, user.getPassword(), "String", factory, true, "PropertyBasicUserPassword", 4);
item.getProperties().getValue().getProperty().add(prop);
ConfigurationItem result = iServer.invokeMethod(item, "AddBasicUser");
}