Are there any OSGi web service / SOAP clients out there? - java

I'm looking for any webservice client that can be run inside an OSGi container and connect to a simple web service using SOAP, doesn't sound so hard does it?
Oh, and it has to work under Java 1.5, so the JRE jax-ws wont be present.
The problem is I've tried a few solutions now, and although each solution works in standard Java using it from within OSGi doesn't.
the springsource JAX-WS bundles seem to have dependency issues
the CXF bundles get me as far as calling the service, but then can seem to find the stub methods in the proxy
Is there anyone out there who has successfully created an OSGi webservice client?

try to use Apache CXF Distributed OSGi (1) that is a reference implementation of OSGi Remote Services Specification.
Regards,
Dmytro
(1): http://cxf.apache.org/distributed-osgi.html

Related

CXF and standalone web services

I'm currently writing a few applications that contain web service clients and servers, as complete standalone applications, eg without any web application server / servlet engine. I'm using plain Java 6, and for the "server" part I'm using the sun HttpServer. Working like a charm.
(actually I am using CXF, but only for their wsdl2java tool, which is more flexible than the one that ships with Java 6).
I've been wondering now if there is any benefit for me to look at frameworks like CXF. Strangely enough, I can't find any information on the CXF web site on such a scenario, they just seem to blindly assume that everybody uses an applications server (and worse, maven).
One of the reasons why I'm looking at CXF is that in the near future I expect that I need to support AIX as well, and there I can't use:
reqcontext.put(BindingProviderProperties.CONNECT_TIMEOUT, connect_timeout);
reqcontext.put(BindingProviderProperties.REQUEST_TIMEOUT, request_timeout);
CXF has this thing called an HTTPClientPolicy which would nicely fit the bill.
Does anybody have any links to articles discussing using CXF without any application server / servlet engine? Are there any other benefits that CXF could give me over the current Java 6 JAX-WS implementation?
Maarten
Almost all the samples that come in the CXF distribution are setup specifically as a "main method" type service that starts up the service and clients and such as standalone applications without any use of an app server (or even Tomcat). The CXF samples would be a good place to start.
That said, they do all use Maven now. :-)

WCF Self-Hosting capabilities in Java

Hi guys is there a way to self-host a web service in Java just like WCF?
Jersey using Grizzly embedded within it would seem like a good fit for your needs. It wouldn't require and outside application server and would be fairly lightweight to get setup. You can just read the Jersey getting started documents to get going with that exact path:
Jersey User Guide
If by self-hosting you mean generating a web service endpoint for invocation, there are a number of ways to go on this, depending on your potential deployment environment.
I'd start off looking at Oracle's JAX-WS implementation, which includes RESTful capabilities. If you want to run a relatively simple stack, you could use Apache Axis2. And then JBoss has JBossWS, which can run standalone or in the JBoss Application Server. I'm pretty sure most of the major application server engines have a Web Services component as well.

JAX-WS client: JAXB required?

I need to "dive into JAX-WS programming".
So, I played around with Netbeans, after 20 or so erroneous attempts,
finally managed to let a web service client execute a web service.
I noticed, that a lot of code is generated, especially JAXB classes
for the web service response.
My current task is, to write a web service and web client completely
by hand.
Is JAXB required at all? Is is part of the standard anyway? What would happen without it?
EDIT:
Seems that the answer is given here
You can see Developing Web Services with Java 2 Platform, Enterprise Edition (J2EE) 1.4 Platform
I took a wsdl and used eclipse to generate the service, serviceLocator, ws interface, ws binding stub, ws proxy, and then the client code. I added a main method and was able to hit the webservice successfully.
I used this tutorial as a guide with the url below and no, there are no jaxb objects as I'm not pulling any objects back in the simple example I used. I was just hitting some methods that pulled back a boolean value.
http://px.pats.no/px/Eclipse_tutorial.html

JBoss: How to generate a Web Service FROM a WSDL?

I need to prototype a very simple system which sends a request to a remote web service, which will then callback on my own web service once it's finished processing. Unfortunately, I have to implement their WSDL for the callback.
Is there a nice simple way of generating a JBoss application which will correctly implement the WSDL, and run some trivial java code?
I tried wsdl2java from Apache CXF, but that only gave me a standalone server, not a deployable one.
Does this tutorial help?
Have a look at Axis2.

spring + tomcat + axis2 == jax-ws web service?

I'm looking for a straightforward example / tutorial for implementing a JAX-WS (soap1.1 and soap1.2) web service based on wsdl definition using spring, axis2 and tomcat.
hint anyone ?
-- Yonatan
There is no such thing as "straightforward" in the world of SOAP. Any example and tutorial is bound to be complex due to the overengineered nature of this beast.
If you can choose your technologies, I'd recommend putting axis aside, and using Tomcat 6 + Java 6 + Metro. Metro is Sun's latest, greatest Java web services (jax-ws) stack. Coupled with JavaEE annotations, it's a relatively painless way to get a web service off the ground quickly.
Sorry to not answer the question directly.
Unfortunately, even the latest version of Metro has issues with tomcat and JDK6
I tried running the sample app on my machine and documented few issues I faced and resolved.
For others benefit please check here :
Running Metro + Tomcat 6 + JDK 6
The NetBeans IDE is good place to start. Enable the Axis2 Support in NB plug-ins. You can create a JAX-WS based Web Service from the WSDL (assuming you are using contract first) and the JAX-WS based WS client too. If you dont like what NetBeans generates or its deployment strategy, you can still build upon the code that it has generated
Axis2 does not support Spring web services when using Jax-WS. See this mailing list post:
http://markmail.org/message/hohdmsupo3r3gltl?q=list:org%2Eapache%2Ews%2Eaxis-user+spring+jax-ws
To do this you will need a custom module to add a BeanFactory into the MessageContext and then retrieve it out in your web service. Or you might write a custom dispatcher.

Categories

Resources