Avatar billede fredand Forsker
05. oktober 2008 - 21:55 Der er 4 kommentarer og
1 løsning

Is Jibx the solution for me?

Hello!

I need to transfer a ArrayList filled with objects of a homemade class over SOAP with Axis2.

Correct me when I say that that is not possible with out something like Jibx?

Or is this possible with just Axis2?

Best regards
Fredrik
Avatar billede arne_v Ekspert
05. oktober 2008 - 22:01 #1
If your homemade class has proper getters and setters, then you can send
an array of that class without problems.

And you can easily convert an ArrayList to an array. Axis2 may actually convert the
ArrayList to an array itself, but I would prefer to do it explicit.

The bottom line is: no problem.
Avatar billede fredand Forsker
06. oktober 2008 - 08:43 #2
Hello!

Thanks for your reply!

The idea that I got is that I have ejb implementation like:

public ArrayList getList()... (returns a nice list from a db)

What I would love to do is the same, but over SOAP. In other words return a ArrayList, and not a Array. (Even if a Array would be as nice).

Or I'm I wrong? Perhaps it is not possible at all to return such a ArrayList over SOAP. Perhaps I need to do it as a Array (Object[])?

Best regards
Fredrik
Avatar billede arne_v Ekspert
06. oktober 2008 - 15:09 #3
Just make a little wrapper that converts the ArrayList to an array and expose
that as a web service.

You can obviously not expose a java.util.ArrayList an expect .NET, PHP and Python code
to be able to consume that.

As I said then it is possible that if you expose your existing method it will be
converted to returning an array by your web service toolkit. But I prefer the
explicit conversion anyway.

I was assuming that all elements in the ArrayList were the same type so you could
return X[].

If it contains different types, then we have a problem.
Avatar billede fredand Forsker
06. oktober 2008 - 20:43 #4
Hello Arne!

Thanks foor your  reply!

You got a very very good argument there!

"You can obviously not expose a java.util.ArrayList an expect .NET, PHP and Python code to be able to consume that."

I did not think about that!

Thanks a lot mate!

Please give a svar so I can reward you mate!
Avatar billede arne_v Ekspert
06. oktober 2008 - 21:00 #5
ok
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester