Results 1 to 7 of 7

Thread: Return data from J2EE web service

  1. #1
    Join Date
    Apr 2010
    Posts
    84

    Return data from J2EE web service

    I have a problem with a web service. I need more than one list as the return from a web service. Since Java is now time to return only one response, I did it with a Class tries in which the lists are there as a variable. Unfortunately, the result is always empty, for these lists have to return the client no more data - even if they were in Java still filled correctly. If I can be for example in the return-class individual variables include these filled correctly returned but the lists are empty. I am looking for some help from your side.!!

  2. #2
    Join Date
    Mar 2008
    Posts
    227

    Re: Return data from J2EE web service

    Depends a lot on, have very little experience as myself but it is very tough to discover the problem without the sample of coding. So it is kind request that if you provide the code, it would be better for me as well as others to point out the problem. So if you want some good solution, provide the appropriate coding.

  3. #3
    Join Date
    Apr 2010
    Posts
    84

    Re: Return data from J2EE web service

    Sorry for an inconvenience that caused because of me. I enclose a short code snippet:
    Code:
    public Master Calc (float a, float b) 
    ( 
    Master ret = new Master (); 
    ret.Ret = new StrReturn [2]; 
    
    ret.Ret [0] = new StrReturn (); 
    ret.Ret [0]. erg = String.valueOf (a + b); 
    ret.Ret [0]. text = "First Results"; 
    
    ret.Ret [1] = new StrReturn (); 
    ret.Ret [1]. erg = String.valueOf (a - b); 
    ret.Ret [1]. text = "Second result"; 
    
    ret.Time = "Time: 15:05:86.455"; 
    ret.Date = "Date: Mon 04.02.2008"; 
    
    return ret; 
    ) 
    
    
    public class Master implements Serializable 
    ( 
    public StrReturn [] Ret; 
    
    public String time; 
    public String date; 
    ) 
    
    public class StrReturn implements Serializable 
    ( 
    public String erg; 
    public String text; 
    )
    The method Calc is published in the web service method. The two Class definitions are the data classes that are used as the return. If I call the method/Web service, then time and date is set, but the list is always empty Ret. When someone has an idea for what is wrong or whether I'm generally a Delusions or subject it to my problem is a much better solution other. There, I am very grateful for everything.

  4. #4
    Join Date
    Mar 2008
    Posts
    232

    Re: Return data from J2EE web service

    To make the class-members practice public is questionable. Better would be to provide java-bean properties. Also, it depends on your container WebService: axis, cxf, etc. I would look at the HTTP response times - then one sees immediately whether the problem is with the server or the client side.

  5. #5
    Join Date
    Apr 2010
    Posts
    71

    Re: Return data from J2EE web service

    I am also having the similar problem, so thought to post here. I work at SAP, and use any web framework. The WSDL is a SAP generated plugin in the eclipse IDE. As a transport protocol, we are currently using nor HTML. I test the web service via a website, which on deployment against the SAP Server is generated. But even to the call via the WSDL from SAP the same result. Please help me to sort out the problem.

  6. #6
    Join Date
    Apr 2010
    Posts
    84

    Re: Return data from J2EE web service

    I looked at the response and it looks like this:
    Code:
     <SOAP-ENV:Body> 
    <rpl:Master_AddResponse xmlns:rpl='urn:Stl_calc_allVi'> 
    <rpl:Response xmlns:pns='urn:calc_package'> 
    <pns:Zeit> time: 15:05:86.455 </ pns: Time> 
    <pns:Datum> Date: Mon 02/04/2008 </ pns: date> 
    </ Rpl: Response> 
    </ Rpl: Master_AddResponse> 
    </ SOAP-ENV: Body> 
    </ SOAP-ENV: Envelope>
    This shows that only time and date as there are variables in the return. Only I know right now is not what I can do with it. I know now that it comes from the server, but how can I fix it now.

  7. #7
    Join Date
    Aug 2006
    Posts
    235

    Re: Return data from J2EE web service

    If I'm not mistaken, the SOAP stack in at least Netweaver already well on the basis of Axis 1.x is end, the author uses a framework but then so (if my memory will not let me down). We generally have quite good experience with writing your own serializer / deserializer for such things, and package the data in Composites (which belongs to the serializers) to use directly instead of SAAJ (which AXIS 1.x Standard / when I was even the right in the head). This shows clearly that nothing was sent from the server. Now I would check (preferably with a unit test) the arrays were actually placed before the object is returned.

Similar Threads

  1. DSM SA Data Manager service won't start
    By Christopher in forum Small Business Server
    Replies: 4
    Last Post: 31-12-2013, 10:35 AM
  2. Replies: 5
    Last Post: 21-02-2012, 06:27 PM
  3. Replies: 7
    Last Post: 18-02-2012, 04:19 PM
  4. IPhone -Data drain during midnight in o2 Service
    By Olenka in forum Portable Devices
    Replies: 10
    Last Post: 03-09-2011, 10:48 PM
  5. Data service on the htc Evo 3D
    By Dakshayani in forum Portable Devices
    Replies: 5
    Last Post: 25-06-2011, 11:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,196,628.61871 seconds with 17 queries