[mule-user] CXF example http://www.mulesource.org/display/CXF/Bookstore+Example

49 views
Skip to first unread message

LexeY

unread,
Dec 3, 2007, 10:57:29 AM12/3/07
to us...@mule.codehaus.org

I run this example of using CXF, and i have next questions:

1) how can i get access to web services via URL, for example, if wsdl file
here http://localhost:8080/services/bookstore?wsdl i want to use url
http://localhost:8080/services/bookstore/getBooks for get all books, but i
can't do it.

2) how can i write client for standalone application for this web service???
--
View this message in context: http://www.nabble.com/CXF-example-http%3A--www.mulesource.org-display-CXF-Bookstore%2BExample-tf4937454.html#a14132753
Sent from the Mule - User mailing list archive at Nabble.com.


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

http://xircles.codehaus.org/manage_email

Dan Diephouse

unread,
Dec 3, 2007, 2:07:44 PM12/3/07
to us...@mule.codehaus.org
LexeY wrote:
> I run this example of using CXF, and i have next questions:
>
> 1) how can i get access to web services via URL, for example, if wsdl file
> here http://localhost:8080/services/bookstore?wsdl i want to use url
> http://localhost:8080/services/bookstore/getBooks for get all books, but i
> can't do it.
>
This is not working with Mule 1.4.3 due to a limitation in the HTTP
transport inside mule. I've fixed it in the 1.4.4 tree, but I'm not 100%
when that will be out. In the meantime you can try a 1.4.4 snapshot if
you want.

> 2) how can i write client for standalone application for this web service???
>
WSDL2Java? :-)

Or inside mule:
http://www.mulesource.org/display/CXF/Client+Outbound+Endpoint

- Dan

--
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com/blog

LexeY

unread,
Dec 4, 2007, 2:21:36 AM12/4/07
to us...@mule.codehaus.org

I used wsdl2java and create requirements classes, but when i running client i
have exception:
java.lang.NoSuchMethodError:
javax.xml.soap.SOAPFactory.createFault()Ljavax/xml/soap/SOAPFault;
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:151)

--
View this message in context: http://www.nabble.com/CXF-example-http%3A--www.mulesource.org-display-CXF-Bookstore%2BExample-tf4937454.html#a14145878


Sent from the Mule - User mailing list archive at Nabble.com.

LexeY

unread,
Dec 4, 2007, 2:51:13 AM12/4/07
to us...@mule.codehaus.org

This example contains class ClientMain in server side (mule-bookstore-demo),
it's eork fine. Whei i copy this client code:

JaxWsProxyFactoryBean pf = new JaxWsProxyFactoryBean();
pf.setServiceClass(Bookstore.class);
pf.setAddress("http://localhost:8080/services/bookstore");
Bookstore bookstore = (Bookstore) pf.create();

Collection<Book> books = bookstore.getBooks();

and run in on client (mule-publisher-demo) it throw exception:
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Could not
find conduit initiator for transport http://schemas.xmlsoap.org/soap/http
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
at $Proxy33.getBooks(Unknown Source)
at org.mule.example.bookstore.publisher.Main.main(Main.java:21)
Caused by: java.lang.RuntimeException: Could not find conduit initiator for
transport http://schemas.xmlsoap.org/soap/http
at
org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:148)
at
org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:73)
at
org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:61)
at
org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:417)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
... 2 more

how can i use this service from client?

--
View this message in context: http://www.nabble.com/CXF-example-http%3A--www.mulesource.org-display-CXF-Bookstore%2BExample-tf4937454.html#a14146150


Sent from the Mule - User mailing list archive at Nabble.com.

Dan Diephouse

unread,
Dec 4, 2007, 12:56:28 PM12/4/07
to us...@mule.codehaus.org
You need to ensure that the geronimo-saaj jar is not on your classpath I believe.

- Dan

Dan Diephouse

unread,
Dec 4, 2007, 12:57:45 PM12/4/07
to us...@mule.codehaus.org
You need to ensure that you have the cxf-rt-transport-jetty-http.jar on your classpath. While it says "jetty" in the title, it has something that is needed for the client interaction I think. It shouldn't require you to actually have jetty on the classpath when you use it. I believe that this is fixed in CXF 2.0.3 which the CXF transport will use in the M3 release.

Cheers,
- Dan
Reply all
Reply to author
Forward
0 new messages