You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Fergusson, Hamish" <Ha...@sabre-holdings.com> on 2004/09/08 17:16:43 UTC
Jibx, jaxb and webservices question
Hello All,
I have the following situation and am wondering if any of you can offer any suggestions as to how to best handle it :
1) I have added a new method to the wsdl and this method basically accepts the given input and then has to transform/map the data into an xml structure ( not SOAP ) to send to some other server ( not a Web Service ) and then await a response from this server and map the xml response back into the java objects ( defined in the wsdl ) to send back to the client who called my web service.
2) The problem I have here is that there is not a 1 to 1 mapping from the request objects ( defined in my wsdl ) and the xml I have to send to the other server.
I have looked into using jaxb to create java object from the schema of the xml I have to send to this other server and I could do it that way, but the problem with this solution is that I have to write additional code to map my java request objects into the corresponding jaxb generated java objects. Sounds like a drag to me!
I have also looked into using Jibx. This looks intriguing, as it looks as if I can bypass java object to object mapping on the server and basically map the java object from my web service request straight to the xml I need. My only concern about Jibx is that it modifies the byte code. This sounds dangerous to me and I'm not sure I want to use it.
Do any of you know if Jibx is safe to use or if there are any alternatives that provide jibx like behavior?
Thanks,
Hamish.
Re: Jibx, jaxb and webservices question
Posted by Paul Callahan <ca...@gmail.com>.
This sounds like a good candidate for XSL. If you were to use a
message-style service, you could obtain the XML DOM directly, do the
transformation via XSL to send to the remote system. To return, just
transform back with XSL again and return the resulting Dom... might
be worth thinking about--of course that might not be as speedy as the
jibx thing.
On Wed, 8 Sep 2004 10:16:43 -0500, Fergusson, Hamish
<ha...@sabre-holdings.com> wrote:
> Hello All,
>
> I have the following situation and am wondering if any of you can offer any suggestions as to how to best handle it :
>
> 1) I have added a new method to the wsdl and this method basically accepts the given input and then has to transform/map the data into an xml structure ( not SOAP ) to send to some other server ( not a Web Service ) and then await a response from this server and map the xml response back into the java objects ( defined in the wsdl ) to send back to the client who called my web service.
>
> 2) The problem I have here is that there is not a 1 to 1 mapping from the request objects ( defined in my wsdl ) and the xml I have to send to the other server.
>
> I have looked into using jaxb to create java object from the schema of the xml I have to send to this other server and I could do it that way, but the problem with this solution is that I have to write additional code to map my java request objects into the corresponding jaxb generated java objects. Sounds like a drag to me!
>
> I have also looked into using Jibx. This looks intriguing, as it looks as if I can bypass java object to object mapping on the server and basically map the java object from my web service request straight to the xml I need. My only concern about Jibx is that it modifies the byte code. This sounds dangerous to me and I'm not sure I want to use it.
>
> Do any of you know if Jibx is safe to use or if there are any alternatives that provide jibx like behavior?
>
> Thanks,
>
> Hamish.
>
Re: Jibx, jaxb and webservices question
Posted by Jochen Wiedmann <jo...@freenet.de>.
Fergusson, Hamish wrote:
> I have looked into using jaxb to create java object from the schema of the
> xml I have to send to this other server and I could do it that way,
> but the problem with this solution is that I have to write additional
code
> to map my java request objects into the corresponding jaxb generated java
> objects. Sounds like a drag to me!
Join the JaxMe project and contribute code that generates the required
mappings.
Jochen
--
http://lilypie.com/baby1/050423/1/5/1/+1
Re: Jibx, jaxb and webservices question
Posted by to...@gsk.com.
Hamish,
I've just been made aware of Apache XML Beans. It seems one can compile
XML Schema into Java classes that can access an underlying DOM in a Java
friendly way. Maybe you can access the incoming SOAP body using XML Beans,
create your new Java objects (with XML Beans generated from your other
schema) and then send the resultant XML to the other server. The same
could be done for the response.
Just a thought.
Tony
Hello All,
I have the following situation and am wondering if any of you can offer
any suggestions as to how to best handle it :
1) I have added a new method to the wsdl and this method basically accepts
the given input and then has to transform/map the data into an xml
structure ( not SOAP ) to send to some other server ( not a Web Service )
and then await a response from this server and map the xml response back
into the java objects ( defined in the wsdl ) to send back to the client
who called my web service.
2) The problem I have here is that there is not a 1 to 1 mapping from the
request objects ( defined in my wsdl ) and the xml I have to send to the
other server.
I have looked into using jaxb to create java object from the schema of the
xml I have to send to this other server and I could do it that way, but
the problem with this solution is that I have to write additional code to
map my java request objects into the corresponding jaxb generated java
objects. Sounds like a drag to me!
I have also looked into using Jibx. This looks intriguing, as it looks as
if I can bypass java object to object mapping on the server and basically
map the java object from my web service request straight to the xml I
need. My only concern about Jibx is that it modifies the byte code. This
sounds dangerous to me and I'm not sure I want to use it.
Do any of you know if Jibx is safe to use or if there are any alternatives
that provide jibx like behavior?
Thanks,
Hamish.
RE: Jibx, jaxb and webservices question
Posted by Marco Mistroni <mm...@waersystems.com>.
Have u tried castor with axis? There's an interesting article on ibm
website about that..
http://www-106.ibm.com/developerworks/webservices/library/ws-castor
-----Original Message-----
From: Fergusson, Hamish [mailto:Hamish.Fergusson@sabre-holdings.com]
Sent: 08 September 2004 16:17
To: axis-dev@ws.apache.org
Cc: axis-user@ws.apache.org
Subject: Jibx, jaxb and webservices question
Hello All,
I have the following situation and am wondering if any of you can offer
any suggestions as to how to best handle it :
1) I have added a new method to the wsdl and this method basically
accepts the given input and then has to transform/map the data into an
xml structure ( not SOAP ) to send to some other server ( not a Web
Service ) and then await a response from this server and map the xml
response back into the java objects ( defined in the wsdl ) to send back
to the client who called my web service.
2) The problem I have here is that there is not a 1 to 1 mapping from
the request objects ( defined in my wsdl ) and the xml I have to send to
the other server.
I have looked into using jaxb to create java object from the schema of
the xml I have to send to this other server and I could do it that way,
but the problem with this solution is that I have to write additional
code to map my java request objects into the corresponding jaxb
generated java objects. Sounds like a drag to me!
I have also looked into using Jibx. This looks intriguing, as it looks
as if I can bypass java object to object mapping on the server and
basically map the java object from my web service request straight to
the xml I need. My only concern about Jibx is that it modifies the byte
code. This sounds dangerous to me and I'm not sure I want to use it.
Do any of you know if Jibx is safe to use or if there are any
alternatives that provide jibx like behavior?
Thanks,
Hamish.