public boolean saveUserProfileImage(String userId, String profileImage, String mediaType) {
   try {
     return stub.saveUserProfileImage(userId, profileImage, mediaType);
   } catch (RemoteException e) {
     log.error(e.getMessage(), e);
     return false;
   }
 }
 public String getUserProfileImage(String userId) {
   try {
     return stub.getUserProfileImage(userId);
   } catch (RemoteException e) {
     log.error(e.getMessage(), e);
     return "";
   }
 }
 public boolean isProfileImageExists(String userId) {
   try {
     return stub.isProfileImageExists(userId);
   } catch (RemoteException e) {
     log.error(e.getMessage(), e);
     return false;
   }
 }
  public GadgetServerSocialDataMgtServiceClient(
      String cookie, String backendServerURL, ConfigurationContext configCtx, Locale locale)
      throws AxisFault {

    String serviceURL = backendServerURL + "GadgetServerSocialDataMgtService";
    stub = new GadgetServerSocialDataMgtServiceStub(configCtx, serviceURL);

    ServiceClient client = stub._getServiceClient();
    Options option = client.getOptions();
    option.setManageSession(true);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
  }
 public PrivacyFieldDTO[] getUserProfile(String userId, String profileName, String[] claimValues) {
   try {
     org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO[] result =
         stub.getUserProfile(userId, profileName, claimValues);
     PrivacyFieldDTO[] profileData = new PrivacyFieldDTO[result.length];
     int index = 0;
     for (org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO data : result) {
       PrivacyFieldDTO obj = new PrivacyFieldDTO();
       obj.setFieldName(data.getFieldName());
       obj.setVisibilityValue(data.getVisibilityValue());
       profileData[index++] = obj;
     }
     return profileData;
   } catch (RemoteException e) {
     log.error(e.getMessage(), e);
     return new PrivacyFieldDTO[0];
   }
 }
 public Boolean updateUserProfile(
     String userId, String profileName, PrivacyFieldDTO[] profileData) {
   try {
     org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO[] profileDataArray =
         new org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO
             [profileData.length];
     int index = 0;
     for (PrivacyFieldDTO data : profileData) {
       org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO obj =
           new org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO();
       obj.setFieldName(data.getFieldName());
       obj.setVisibilityValue(data.getVisibilityValue());
       profileDataArray[index++] = obj;
     }
     return stub.updateUserProfile(userId, profileName, profileDataArray);
   } catch (RemoteException e) {
     log.error(e.getMessage(), e);
     return false;
   }
 }