Re: [Axis2] AxisFault: please help!!

2007-03-08 Thread jpsabadini

Thanks for your anwser!!!


Here is the service class:

/**
 * MobileServiceSkeleton.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis2 version: SNAPSHOT Feb 19, 2007 (03:30:55 GMT+00:00)
 */
package com.vmon.ws.mobile;

import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.Collection;
import java.util.Iterator;

import javax.activation.DataHandler;
import javax.ejb.CreateException;
import javax.mail.util.ByteArrayDataSource;
import javax.naming.NamingException;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;

import org.apache.axis2.context.MessageContext;
import org.apache.axis2.context.SessionContext;
import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpState;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.log4j.Logger;

import com.gauss.orm.exceptions.InfrastructureException;
import com.gauss.vmon.ws.mobile.xsd.CatalogDataType;
import com.gauss.vmon.ws.mobile.xsd.GetCatalog;
import com.gauss.vmon.ws.mobile.xsd.GetCatalogResponse;
import com.gauss.vmon.ws.mobile.xsd.GetImage;
import com.gauss.vmon.ws.mobile.xsd.GetImageResponse;
import com.gauss.vmon.ws.mobile.xsd.Login;
import com.gauss.vmon.ws.mobile.xsd.LoginResponse;
import com.gauss.vmon.ws.util.Constants;

import com.gauss.vmon.orm.data.ObjectCatalogDTO;
import com.gauss.vmon.orm.data.UserDTO;
import com.gauss.vmon.orm.exceptions.UserNotFoundException;

import com.gauss.vmon.ols.data.SnapshotDTO;
import com.gauss.vmon.ols.service.ObjectsLibraryServiceMBean;
import com.gauss.vmon.ols.util.ObjectsLibraryServiceUtil;

import com.gauss.vmon.bl.exceptions.UserNotEnabledException;
import com.gauss.vmon.bl.exceptions.UserWrongPasswordException;
import com.gauss.vmon.bl.interfaces.ObjectServiceEJBLocal;
import com.gauss.vmon.bl.interfaces.ObjectServiceEJBUtil;
import com.gauss.vmon.bl.interfaces.UserServiceEJBLocal;
import com.gauss.vmon.bl.interfaces.UserServiceEJBUtil;
import com.gauss.vmon.bl.interfaces.ViewerServiceEJBLocal;
import com.gauss.vmon.bl.interfaces.ViewerServiceEJBUtil;

import com.gauss.vmon.web.util.MD5;

/**
 *  MobileServiceSkeleton java skeleton for the axisService
 */
public class MobileServiceSkeleton implements MobileServiceSkeletonInterface
{

  private static Logger log = Logger.getLogger(Constants.LOG4J_CATEGORY);
  protected String className =
this.getClass().getName().substring(this.getClass().getName().lastIndexOf(".")
+ 1);

  /*
   * Propiedades de session
   */
  private Integer usrId = null;
  private Integer entId = null;

  private Boolean isLogged = Boolean.FALSE;

  /*
   * Propiedades de session para el Snapshot
   */
  private Boolean isConnected = Boolean.FALSE;
  private Integer objId = null;
  private SnapshotDTO snapshotData = null;
  private HttpClient httpClient = new HttpClient();

  /**
   * Auto generated method signature
   * @param login
   */

  public LoginResponse login(Login login) {
final String methodName = className + "." + "login";
log.debug(methodName + ".Begin");
try {
  SessionContext sessionContext = getSessionContext();
  MessageContext msgCtx = MessageContext.getCurrentMessageContext();
  ServletContext servletContext = (ServletContext)
msgCtx.getProperty("transport.http.servletContext");
  HttpServletRequest httpServletRequest = (HttpServletRequest)
msgCtx.getProperty("transport.http.servletRequest");
  SessionContext sessionCtx = msgCtx.getSessionContext();

  log.debug("ServiceGroupContextId: " +
msgCtx.getServiceGroupContextId());
  log.debug("SessionId: " + msgCtx.getProperty("SessionId"));
  log.debug("Cookie: " + msgCtx.getProperty("Cookie"));

  LoginResponse loginResponse = new LoginResponse();
  loginResponse.setStatus(0);
  log.debug("Logged: " + isLogged);

  if (isLogged) {
loginResponse.setStatus(Constants.WS_LOGIN_STATUS_ALREADY_LOGGED);
return loginResponse;
  }

  UserServiceEJBLocal userService = null;

  try {
userService = UserServiceEJBUtil.getLocalHome().create();
  }
  catch (CreateException e2) {
log.error("Exception in AuthenticationService: " + e2.getMessage());
loginResponse.setStatus(Constants.WS_LOGIN_STATUS_EXCEPTION);
return loginResponse;
  }
  catch (NamingException e2) {
log.error("Exception in AuthenticationService: " + e2.getMessage());
loginResponse.setStatus(Constants.WS_LOGIN_STATUS_EXCEPTION);
return loginResponse;
  }

  UserDTO userData = new UserDTO();
  this.usrId = null;
  this.entId = null;
  this.isLogged = Boolean.FALSE;
  this.isConnected = Boolean.FALSE;
  this.objId = null;
  this.snapshotData = null;

  sessionContext.s

Re: AxisFault: please help!!

2007-03-07 Thread Thilina Gunarathne

Are you also in controll of the service too...
If so if you don't mind please post the services.xml and the service
class.. Also please check the method names of your service class...

Thanks,
Thilina

On 3/8/07, jpsabadini <[EMAIL PROTECTED]> wrote:


Hi all,
I´m getting a org.apache.axis2.AxisFault: ServiceClass does not implement
required method of the form OMElement login(OMElement e) when I´m executing
a test client that consumes a WS.

The client is:

package com.vmon.ws.mobile;

import java.rmi.RemoteException;
import org.apache.log4j.Logger;
import com.gauss.vmon.ws.mobile.xsd.CatalogDataType;
import com.gauss.vmon.ws.mobile.xsd.GetCatalog;
import com.gauss.vmon.ws.mobile.xsd.GetCatalogResponse;
import com.gauss.vmon.ws.mobile.xsd.Login;
import com.gauss.vmon.ws.mobile.xsd.LoginResponse;

public class MobileServiceClient {

  private static Logger log = Logger.getLogger(MobileServiceClient.class);
  protected String className =
this.getClass().getName().substring(this.getClass().getName().lastIndexOf(".")
+ 1);

  public static void main(String[] args)
  throws Exception {

try {

  MobileServiceStub mobileStub = new
MobileServiceStub("http://alpha.vmonitoring.com/services/MobileService";);
  mobileStub._getServiceClient().getOptions().setManageSession(true);

  Login login = new Login();
  login.setUsername("asd");
  login.setPassword("asd");

  LoginResponse loginResponse;

  loginResponse = mobileStub.login(login);
  System.out.println("1: " + loginResponse.getStatus());

  loginResponse = mobileStub.login(login);
  System.out.println("2: " + loginResponse.getStatus());

  GetCatalog getCatalog = new GetCatalog();
  getCatalog.setUsrId(0);

  GetCatalogResponse catalogResponse =
mobileStub.getCatalog(getCatalog);
  CatalogDataType[] cameras = catalogResponse.getCatalogData();

  for (int i = 0; i < cameras.length; i++) {
System.out.println(cameras[i].getObjId() + ", " +
cameras[i].getName());
  }
  System.out.println("FIN");
}
catch (RemoteException e) {
  e.printStackTrace();
}
finally {
}
  }
}

The exception occurs at  loginResponse = mobileStub.login(login);

I don´t know what the exception is!! Any clue?

Thanks in advance.


--
View this message in context: 
http://www.nabble.com/AxisFault%3A-please-help%21%21-tf3364506.html#a9360765
Sent from the Axis - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Thilina Gunarathne
WSO2, Inc.; http://www.wso2.com/
Home page: http://webservices.apache.org/~thilina/
Blog: http://thilinag.blogspot.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AxisFault: please help!!

2007-03-07 Thread jpsabadini

Hi all,
I´m getting a org.apache.axis2.AxisFault: ServiceClass does not implement
required method of the form OMElement login(OMElement e) when I´m executing
a test client that consumes a WS.

The client is:

package com.vmon.ws.mobile;

import java.rmi.RemoteException;
import org.apache.log4j.Logger;
import com.gauss.vmon.ws.mobile.xsd.CatalogDataType;
import com.gauss.vmon.ws.mobile.xsd.GetCatalog;
import com.gauss.vmon.ws.mobile.xsd.GetCatalogResponse;
import com.gauss.vmon.ws.mobile.xsd.Login;
import com.gauss.vmon.ws.mobile.xsd.LoginResponse;

public class MobileServiceClient {

  private static Logger log = Logger.getLogger(MobileServiceClient.class);
  protected String className =
this.getClass().getName().substring(this.getClass().getName().lastIndexOf(".")
+ 1);

  public static void main(String[] args)
  throws Exception {

try {

  MobileServiceStub mobileStub = new
MobileServiceStub("http://alpha.vmonitoring.com/services/MobileService";);
  mobileStub._getServiceClient().getOptions().setManageSession(true);

  Login login = new Login();
  login.setUsername("asd");
  login.setPassword("asd");

  LoginResponse loginResponse;

  loginResponse = mobileStub.login(login);
  System.out.println("1: " + loginResponse.getStatus());

  loginResponse = mobileStub.login(login);
  System.out.println("2: " + loginResponse.getStatus());

  GetCatalog getCatalog = new GetCatalog();
  getCatalog.setUsrId(0);

  GetCatalogResponse catalogResponse =
mobileStub.getCatalog(getCatalog);
  CatalogDataType[] cameras = catalogResponse.getCatalogData();

  for (int i = 0; i < cameras.length; i++) {
System.out.println(cameras[i].getObjId() + ", " +
cameras[i].getName());
  }
  System.out.println("FIN");
}
catch (RemoteException e) {
  e.printStackTrace();
}
finally {
}
  }
}

The exception occurs at  loginResponse = mobileStub.login(login);

I don´t know what the exception is!! Any clue?

Thanks in advance.


-- 
View this message in context: 
http://www.nabble.com/AxisFault%3A-please-help%21%21-tf3364506.html#a9360765
Sent from the Axis - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]