[mule-user] Soap Web service with Mule and Xfire

2 views
Skip to first unread message

su123

unread,
Nov 6, 2008, 2:23:28 AM11/6/08
to us...@mule.codehaus.org

Hi,
I'm trying to build a SOAP web service with Mule 1.4 and Xfire. I have to
pass an xml as a payload, do some processing on it and return an xml back as
a response. I'm using a transformer that transforms the xml to Java Object
and Java Object back to xml before sending the response.
It works fine when i use the HTTPConnector but i'm facing problems when i
use the XfireConnector
I want to test the service using Mule Client.
Any ideas as to how should i go about it.
Thanks in advance
--
View this message in context: http://www.nabble.com/Soap-Web-service-with-Mule-and-Xfire-tp20356187p20356187.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Antoine Borg

unread,
Nov 25, 2008, 3:06:25 AM11/25/08
to us...@mule.codehaus.org
Hi,

When you say that you wish to send/receive XML, do you mean that you want to
send and receive String messages that contain XML? Or that you wish to use
objects based on XML? Or DOM documents?

A

Antoine Borg, Senior Consultant | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM
email: antoin...@ricston.com | blog: blog.ricston.com | web: ricston.com

su123

unread,
Nov 28, 2008, 4:14:47 AM11/28/08
to us...@mule.codehaus.org

Hi ,
Sorry for the late reply.
Presently I'm invoking the web services by using SOAP UI. The payload itself
is an Xml file.
Its expecting a Document object when i use an Xfire connector in the mule
config file.
Since Document object means loading the object in the memory, I want to
convert into a Java object before it comes to the first UMO.
How do i go about that?

Regards,
Su123

--
View this message in context: http://www.nabble.com/Soap-Web-service-with-Mule-and-Xfire-tp20356187p20731079.html

Antoine Borg

unread,
Dec 1, 2008, 5:26:29 AM12/1/08
to us...@mule.codehaus.org
Hold on ..

You say that the payload is an XML file - is this a file object that you're
sending, or a String that contains the XML?

Either way, if you wish to convert to a Document (org.w3c.dom.Document for
instance) have you seen the XML transformers in Mule?

su123

unread,
Dec 2, 2008, 6:35:03 AM12/2/08
to us...@mule.codehaus.org

Hi,
Ok the xml is in the form of the String payload.
I have my own custom inbound transformer that takes the byte[] array
object(This is the object type in the transformer) converts into String,
uses this to convert as a Java object using JAXB.
Now when we return from the transformer, its is handled by a Soap handler
which uses Xstream to read the payload. It is expecting a SOAP message.
Hence I'm unable to use a inbound transformer and the parameter type of the
UMO has to be Document.

Regards,
Su123

--
View this message in context: http://www.nabble.com/Soap-Web-service-with-Mule-and-Xfire-tp20356187p20790429.html

Antoine Borg

unread,
Dec 2, 2008, 8:53:49 AM12/2/08
to us...@mule.codehaus.org
Hi,

A-ha, this makes things a little clearer.

01 - You are sending a string and converting that to an object using JAXB.
Are you doing this on the inbound endpoint? (Showing us your config will
help a little here)

02 - If you wish to use Document as the parameter type of the component,
you should change the SOAP style to "message" not "RPC/Encoded" or
"Doc/Lit"

HTH

A

--
Antoine Borg | Senior Consultant
Ricston Ltd BP 2, 1180 Uccle, Brussels, Belgium
T: +32 28 504 696 M: +32 494 77 47 88 E: antoin...@ricston.com
Read my blog on SOA and Mule topics: http://blog.ricston.com

su123

unread,
Dec 4, 2008, 6:16:03 AM12/4/08
to us...@mule.codehaus.org

Hi,
Ya I'm converting it to a Java object at the inbound end point.
The config file is as below

<transformers>
<transformer name="TestTransformer"
className="com.foo.transformers.TestTransformer"/>
</transformers>

<mule-descriptor name="TravelServices"
implementation="com.foo.service.ProcessRequest">
<interceptor name="default"/>
<inbound-router>
<endpoint address="xfire:http://localhost:65081/services"
type="senderAndReceiver" synchronous="true" transformers="TestTransformer"/>
</inbound-router>
.
.
.
.
.
I don't want the parameter to be taken as a Document as it is a in-memory
representation of the Xml and hence the entire Xml is loaded into the
memory. I want to receive the Java object directly via transformer into my
Component. The problem here is using the binding property of Xfire and JAXB
into my project.

Thanks & Regards,
Su123

--
View this message in context: http://www.nabble.com/Soap-Web-service-with-Mule-and-Xfire-tp20356187p20831508.html

Antoine Borg

unread,
Dec 5, 2008, 2:21:09 AM12/5/08
to us...@mule.codehaus.org
Hi,

It looks like the transformation is interfering here. How about if you had a
proxy service that handled the transformation so that this TravelService
received the properly transformed item?

A

Thanks & Regards,
Su123

>>>> -- To unsubscribe from this list, please visit:
>>>>
>>>> http://xircles.codehaus.org/manage_email
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> -- To unsubscribe from this list, please visit:


>>>>
>>>> http://xircles.codehaus.org/manage_email
>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Soap-Web-service-with-Mule-and-Xfire-tp2035618
>>> 7p207310
>>> 79.html
>>> Sent from the Mule - User mailing list archive at Nabble.com.
>>>
>>>
>>> --------------------------------------------------------------------

>>> - To unsubscribe from this list, please visit:
>>>
>>> http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> - To unsubscribe from this list, please visit:

>> p20790429.html Sent from the Mule - User mailing list archive at

>> Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context:

http://www.nabble.com/Soap-Web-service-with-Mule-and-Xfire-tp20356187p208315
08.html

su123

unread,
Dec 7, 2008, 11:50:01 PM12/7/08
to us...@mule.codehaus.org

Hi,
Could please elaborate on that.

Regards,
su123

--
View this message in context: http://www.nabble.com/Soap-Web-service-with-Mule-and-Xfire-tp20356187p20889488.html

Antoine Borg

unread,
Dec 8, 2008, 2:04:37 AM12/8/08
to us...@mule.codehaus.org
Hi su123,

Yes, of course.

Create a proxy service that has the inbound web service endpoint and
receives all requests. On the outbound endpoint, use the transformer so that
the message is converted as needed. Set the outbound endpoint to invoke the
web service of the real service.

This new service should be a pure proxy but with the addition of the
transformation

A

Regards,
su123

>>> 7 p20790429.html Sent from the Mule - User mailing list archive at
>>> Nabble.com.
>>>
>>>


>>> --------------------------------------------------------------------
>>> - To unsubscribe from this list, please visit:
>>>
>>> http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>
>>
>>

Reply all
Reply to author
Forward
0 new messages