This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Constantinos Grevenitis

Ranch Hand
+ Follow
since Nov 29, 2006
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Constantinos Grevenitis

Hello. I want to build a document that inside the body you have the following.

<results>
<id>1</id><albumname>Eternity</albumname><date>2007-8-21</date><time>23:33:34</time>
<id>2</id><albumname>Dominion</albumname><date>2007-8-22</date><time>23:35:35</time>
...
...
...
<id>10</id><albumname>Ghost
Opera</albumname><date>2007--8-25</date><time>20:25:34</time>
</results>

where the text inside the elements is data from a database. I don't
know how to build this. I don't know how to do it. There is a buildNext() method but the API says nothing about it.
13 years ago
I thought that wasNull() was the one a I was wrong. Is there any method that checks that or do I have to do it "manually"?
Thanks for the help, but the bean is gone now. I re wrote the service class and it's different now. This service was more like a testing service, not the final version. But thanks for the help again.

Yes, one of my problems is that I want to check if the resultset has no records. But I will solve it.

My other problem is with axiom. Now I get the db data and I set them as text to OMElements. There is a buildNext() method but the API says nothing about it. I don't know how exactly it works and I still get the last records. The examples about Axis2 and Axiom are very similar....

The word anathema in greek means a lot of things depenting on how you use it. Greetings from hot Greece. Thanks again.
13 years ago
Ανάθεμα την τρέλα μου, ήταν τόσο απλό και δεν το σκέφτηκα. These words are greek. No, I am not crazy...yet. I found it. I forgot to add the mysql java connector to the axis2 lib directory. I am a bozo. Now I have another question. The client must receive a SOAPdocument that inside the body you have that.

<results>
<id>1</id><albumname>Eternity</albumname><date>2007-8-21</date><time>23:33:34</time>
<id>2</id><albumname>Dominion</albumname><date>2007-8-22</date><time>23:35:35</time>
...
...
...
<id>10</id><albumname>Ghost Opera</albumname><date>2007--8-25</date><time>20:25:34</time>
</results>

where the text inside the elements is the data from the database. I don't know how to build this. I only get the last record. I know that there is a buildNext() method but I don't know what exactyly is doing. Thanks a priori
13 years ago
Hello. I rewrote the service class. I have the same problem. But I have run a test. I realized that when I run the client the service never "enters" the try catch clause, so it never "enters" the database. I believe that the problem might has to do with the org.jdbc.mysql.Driver, because into the aar file that class doesn't exist. So, since it doen't exist the service doesn't know what to with the db. I will check it at home tonight and I will tell you what the results are.

[ August 20, 2007: Message edited by: Constantinos Grevenitis ]
[ August 20, 2007: Message edited by: Constantinos Grevenitis ]
13 years ago
I have already done that. I added a public static void main to the database class and another to the service class in order to test if they worked. They both worked fine. I had the results I wanted. But when I had to run the client and use the web service ....boom. Nothing. I am writing the service now. I will test the new service and I will let you know.
13 years ago
I haven't read the org.w3c.dom.Node yet. I want you to tell me first where I am wrong. This source code returns to the client

id = null
albumname = null
date = null
time = null
13 years ago
I am posting the source code I have written. I can't stand it anymore. I am a total failure.

Some explanations first. I have a setters, getters bean classof database fields. I have a database class that connects to the database and gets the data, and finally I have the Service class. I am posting the Service and the Database classes.




and my Service Class where I import the Database Class



If you need more explanations, tell it
[ August 16, 2007: Message edited by: Constantinos Grevenitis ]
13 years ago
Hello I would like a descent example of connecting to a mysql database using DataSource and Context or InitialContext. I don't which one is better. The database name is Kamelot, the table's name is album. It's a localhost connection. Thank you very much.
Ha ha. Thank you for the news. My Client is waiting OMElement.
13 years ago
Simple. The Service returns to the client the data of a DB table. Just that. But I have to implement it with Axis2 InOut MEP.
13 years ago
Thank for your help, but Async Result was not the problem. I solved that but now I have another problem. I am supposed to get data from a database through Axi2 Web Service. How am I supposed to do that? I mean

1. Do I have to serialize the data from the database using StaX?
2. Or its better to use OMDataSource? (For that I haven't found enough info on the web).

3. Or do nothing, special, just get the data with ResultSet, add the RS add text to an OMelement and send it to the client?

So far I have programmed only opt 3 but I get the null word on screen
13 years ago


My service returns OMElement.
13 years ago
The problem is that AsyncResult prints to screen only the last closing tag, not the whole result. For example, the result the service returns is:

<message><record><id>8</id><albumname>Ghost Opera</albumname><date>2007-08-09</date><time>20:23:40</time></record></message>

and AsyncResult "shows" me only </message>.
13 years ago
The exception that I get is this one:

org.apache.axis2.AxisFault: The getSOAPMessage operation cannot be found.
at org.apache.axis2.client.ServiceClient.createClient(ServiceClient.java:584)
at org.apache.axis2.client.ServiceClient.sendReceiveNonBlocking(ServiceClient.java:560)
at eKONES.client.Client.main(Client.java:70)

==============================================================================

The problem problably has to do with QName. Also I would like to explain what setAction("urn:echo") is, and what kind of args setAction() can get. I also give you services.xml
============================================================================


==========================================================================

<service name="eKONES">

<parameter name="ServiceClass" locked="xsd:false"> eKONES.service.SOAPService </parameter>

<operation name="getSOAPMessage">
<messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
</operation>

</service>
13 years ago