getting InvocationTargetException trying to return a bean..

Discussion in 'Java' started by Elhanan, Mar 15, 2005.

  1. Elhanan

    Elhanan Guest

    hi..

    i have axis 1.1

    when i try to use a web service such as this:

    class BeanData{
    private String messageData;
    private int messageCode;
    public BeanData(){};
    public BeanData(int Code,String Data)
    {
    messageCode=Code;
    messageData=Data;
    }
    public String getmessageData(){return messageData;}
    public int getmessageCode(){return messageCode;}
    public void setmessageData(String value){messageData=value;}
    public void setmessageCode(int value){messageCode=value;}
    }

    public class TestBean {

    public BeanData getBean()
    {
    BeanData d= new BeanData();
    return d;
    }
    public String getString()
    {
    return "Me";
    }
    }
    from this client:

    Call c =(Call) new Service().createCall();
    c.setTargetEndpointAddress("http://localhost:8080/axis/TestBean.jws");
    c.setOperationName("getBean");
    QName q= new QName("urn:BeanService","BeanData");
    c.registerTypeMapping(BeanData.class,q
    ,new BeanSerializerFactory(BeanData.class,q)
    ,new BeanDeserializerFactory(BeanData.class,q));
    c.setReturnClass(BeanData.class); Object b= c.invoke(new
    Object[]{});

    i get java.lang.reflect.InvocationTargetException

    how i also use this from a dotnet client?
     
    Elhanan, Mar 15, 2005
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Benjamin Stewart

    To bean or not to bean...

    Benjamin Stewart, Jun 30, 2003, in forum: Java
    Replies:
    0
    Views:
    985
    Benjamin Stewart
    Jun 30, 2003
  2. David Thielen
    Replies:
    2
    Views:
    992
    Marek Lange
    Sep 12, 2003
  3. Markku Salminen
    Replies:
    3
    Views:
    6,081
    Michael Borgwardt
    Jan 21, 2004
  4. Takeshi
    Replies:
    0
    Views:
    765
    Takeshi
    Jan 28, 2004
  5. kumar
    Replies:
    1
    Views:
    717
    Wendy S
    Feb 13, 2004
  6. Thomas P. Fuller
    Replies:
    1
    Views:
    4,971
    bitbucket43
    Aug 17, 2004
  7. jill
    Replies:
    5
    Views:
    16,731
  8. ×לחנן

    trying to return a bean from a java web service...

    ×לחנן, Mar 15, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    168
    ×לחנן
    Mar 15, 2005
Loading...