diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/APIPublisherConfig.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/APIPublisherConfig.java index 27454d10c90..faeaa2474b6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/APIPublisherConfig.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/config/APIPublisherConfig.java @@ -16,6 +16,7 @@ package org.wso2.carbon.device.mgt.mobile.config; import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; import java.util.List; @@ -24,12 +25,13 @@ public class APIPublisherConfig { private List apis; - @XmlElement(name = "APIs") - public List getApis() { + @XmlElementWrapper(name = "APIs", nillable = false, required = true) + @XmlElement(name = "API", nillable = false) + public List getAPIs() { return apis; } - public void setApis(List apis) { + public void setAPIs(List apis) { this.apis = apis; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/internal/MobileDeviceManagementBundleActivator.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/internal/MobileDeviceManagementBundleActivator.java index e6eed7b7711..2d1fb04ad20 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/internal/MobileDeviceManagementBundleActivator.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/internal/MobileDeviceManagementBundleActivator.java @@ -133,7 +133,7 @@ public class MobileDeviceManagementBundleActivator implements BundleActivator, B private void initAPIConfigs() throws DeviceManagementException { List apiConfigs = MobileDeviceConfigurationManager.getInstance().getMobileDeviceManagementConfig(). - getApiPublisherConfig().getApis(); + getApiPublisherConfig().getAPIs(); for (APIConfig apiConfig : apiConfigs) { try { APIProvider provider = APIManagerFactory.getInstance().getAPIProvider(apiConfig.getOwner()); @@ -148,7 +148,7 @@ public class MobileDeviceManagementBundleActivator implements BundleActivator, B private void publishAPIs() throws DeviceManagementException { List apiConfigs = MobileDeviceConfigurationManager.getInstance().getMobileDeviceManagementConfig(). - getApiPublisherConfig().getApis(); + getApiPublisherConfig().getAPIs(); for (APIConfig apiConfig : apiConfigs) { DeviceManagementAPIPublisherUtil.publishAPI(apiConfig); } @@ -157,7 +157,7 @@ public class MobileDeviceManagementBundleActivator implements BundleActivator, B private void removeAPIs() throws DeviceManagementException { List apiConfigs = MobileDeviceConfigurationManager.getInstance().getMobileDeviceManagementConfig(). - getApiPublisherConfig().getApis(); + getApiPublisherConfig().getAPIs(); for (APIConfig apiConfig : apiConfigs) { DeviceManagementAPIPublisherUtil.removeAPI(apiConfig); } diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/conf/mobile-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/conf/mobile-config.xml index 73ca2224359..bac7bdd5c89 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/conf/mobile-config.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/conf/mobile-config.xml @@ -25,13 +25,15 @@ - - enrollment - admin - enrollment - 1.0.0 - http://localhost:9763/ - http,https - + + + enrollment + admin + enrollment + 1.0.0 + http://localhost:9763/ + http,https + +