Wap Rau

Greenhorn
+ Follow
since Dec 01, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Wap Rau

Ivan Krizsan wrote:Hi!
You should really try to avoid that kind of multidimensional arrays. It makes your code much more difficult to understand and maintain.
Instead, implement a Java-bean class that represents one row of data from, in this case, the database.
Then, for each row in the database query result, create an instance and populate its data.
Finally, insert each instance of the Java-bean in an array and return that array.
Best wishes!



Thanks Ivan Krizsan, It worked.
10 years ago

Arun Kumar wrote:Try this in your code
@SOAPBinding
(
style = SOAPBinding.Style.DOCUMENT,
use = SOAPBinding.Use.LITERAL,
parameterStyle = SOAPBinding.ParameterStyle.WRAPPED
)



Thanks Arun Kumar for your reply. I will try your solution. Thanks again for responding.
10 years ago

Ivan Krizsan wrote:Hi!
I think that the reason for the element in question being named <item> may be related to the fact that you use RPC binding.
Have you tried using DOCUMENT style binding?
Best wishes!



Thanks Ivan Krizsan, for your reply. I am very new to Web Services. Could you provide me with links to the resources for such DOCUMENT style binding?

Thanks again,

Wap Rau
10 years ago

Ivan Krizsan wrote:Hi!
You should really try to avoid that kind of multidimensional arrays. It makes your code much more difficult to understand and maintain.
Instead, implement a Java-bean class that represents one row of data from, in this case, the database.
Then, for each row in the database query result, create an instance and populate its data.
Finally, insert each instance of the Java-bean in an array and return that array.
Best wishes!

Thanks Ivan Krizsan, for your reply. I will try your solution.
10 years ago
I am very new to Web Services. I am creating Apache CXF (apache-cxf-2.5.0) SOAP based Web Services. It creates WSDL from Java class (Java first approach).

When Web Service is called I am returning 2D array as a response. This is my Java class:


This is the response to the request I get when Web Service is called:


The Response that I get from the webservice has a tag <item> under <return> tag. However, I want <parameter-name> instead of <item> like this:


How to do it? Thanks.
10 years ago
Hello Nitin Bhardwaj,

Have you ever been able to get <item> named as <company>? If yes, how?

Thanks.

Wap Rau
10 years ago
My problem is more or less solved. The problem was with my Java class in which I was having class level variables. I changed it and made it method level variables and now I am getting result as expected.

Thank you.
10 years ago
I am very new to Web Services. I am creating Apache CXF (apache-cxf-2.5.0) SOAP based Web Services. It creates WSDL from Java class (Java first approach).

Following is my Java class:



This is WSDL created at the specified URL:


I am using soapUI for testing. This is the request generated when I use soapUI :



This is the response I get when I submit request to specified endpoint URL for the FIRST time:


However when I resubmit request again I get following response everytime I submit request:



Actually I am expecting the same response when I submit request for the FIRST time. But somehow every time I submit request I get above response without any data. How to get rid of this?

Thank you.
10 years ago
Thanks Arun Kumar, Ivan Krizsan for your answers.

I am creating Apache CXF (apache-cxf-2.5.0) SOAP based Web Services. It creates WSDL from Java class (Java first approach). I have to use SOAP and can't use REST.

I am retrieving data from database using ResultSet. Data is about 5 columns and over 100 rows. Now I want to send this data to Android client. I am thinking of converting ResultSet into ArrayList and sending ArrayList / List object as a response from SOAP Web Service. My problem is - is it possible to send List object as a reponse from SOAP Web Service. If yes, please provide me link to such an examples.

Thank you.
10 years ago

Arun Kumar wrote:you can use jdbc/hibernate to get the data from database and pass it as POJO/String response via apache-cxf


Thanks Arun Kumar for your answer. I am new to Web Services. I am having three doubts:

1. If I want to send data as a String data, how to send that from the function (say sendData()) in my Java class as examples on the internet have shown sending only one String as a response?

2. Is it possible/OK to send/return POJO as a response?

3. If I want to send data as POJO, how client which is a Android application can know which type of data is this and retrieve data from POJO?

Thanks.
10 years ago
I am using Apache CXF (apache-cxf-2.5.0) to create Web Services using bottum up approach (Java first approach). I want to return some data / records (for example username, email) from a database table using web services created by bottum up approach (Java first approach). I can write Java class which returns single response. But I am not able to find way to return a response such as data / records (for example username, email) from a database table. How to do that?

Thanks.
10 years ago