Creating web service client in Eclipse and NetBeans - java

I have web service created using .NET C#. I have generated web service using both NetBeans and Eclipse wizzards. In both cases web service clients are running but both clients has very different implementation. In NetBeans case i got to use many jar libraries like:
jax-qname.jar,
jaxrpc-api.jar,
jaxrpc-impl.jar,
jaxrpc-spi.jar
and others.
In Eclipse case I'm pushed to use less libs like:
jaxrpc.jar,
javax.wsdl_1.6.2.v201012040545.jar,
commons-discovery-0.2.jar,
org.apache.commons.logging_1.1.1.v201101211721.jar,
saaj.jar
For me Eclipse client looks nicer - it has less code generated and requires less libs. But which one is better? What kind of technologies the are using? And finally - can I create web service client without using any third party libs?

Related

Deploy Java restful web service to live server

I have just learned to create java rest API using jersey and Oracle database.
I'm developing in eclipse and using weblogic server to run and test web service on localhost.
My question is what are the options of live servers to deploy this service so that I can access this API in my android application or any web application???
You can do that. But you have to make sure that all the dependent jars are packaged with the your WAR project(eg; Oracle db related things).
Some blog entries which give you an idea about what are all these servers and which one to pick for open development and common standards - http://blogs.forrester.com/mike_gualtieri/11-07-15-stop_wasting_money_on_weblogic_websphere_and_jboss_application_servers,
and this one http://zeroturnaround.com/rebellabs/the-great-java-application-server-debate-with-tomcat-jboss-glassfish-jetty-and-liberty-profile/
This will give pretty good idea about what is all these servers :)

How can i export gwt project to external web server?

I have created a web application using google web toolkit, it works fine launching it from eclipse. I want to put it on my server so I compile it with gwt compile and put the war folder on server. Client works well but the rpc calls return "not found error" on javascript console. I feel like i missed one step: maybe I should launch java server for rpc first, but i don't understand how to do it.
GWT-RPC requires a servlet container: Tomcat, Jetty, etc.
If your "server" is Apache HTTPD, Nginx, Lighttpd, etc. then it's not enough.
An alternative is to not use GWT-RPC so you can code your server-side in another language (PHP, Ruby, etc.) That requires much more work on GWT's client side though.

Does a standalone Java WebSocket server library exist?

I need to integrate a WebSocket server into my existing Java desktop application. As such, I need an implementation that includes a web server. Even the Play! Framework seems like overkill for this case. Do I have any other options?

Creating a web-services client in Eclipse

I need to create a web services client in java/Eclipse to interface with a test management tool from my java testing code.
I successfully set up the client in NetBeans. This was a fairly painless process using NetBeans' wizard.
However, Eclipse is our IDE of choice, so I need to get the code over to it. I have found and followed steps to implement a web services client in Eclipse. The process in Eclipse is a lot clunkier IMO, but I successfully generated the client.
However, Netbeans and Eclipse don't seem to agree on what the information in the wsdl file means. NetBeans discovers/creates a larger collection of classes in its 'generated sources' folder than Eclipse does.
I must be missing something?
Looking for anyone who tried to create a ws client in both Netbeans and Eclipse, and is able to shed some light on why there are differences in the code created from the wsdl file, and how to work around it.
Thanks.
When you create a client using the wizard "Web Service Client" Eclipse, you are using a runtime for WS. I'm using Java EE developer version of Eclipse Helios (3.6) + JBoss Tools, With JBoss 6.0 server, and I have 4 different runtimes available.
Apache Axis
Apache Axis2
Apache CXF 2.x
JBossWS
Which runtime (framework) are you using under Netbeans?
Using JBossWS, I generated WS client classes from WSDL, and I'm using them in a maven Java EE 6 application, deployed to a JBoss 6.0, and it works perfectly, inside Eclipse and outside (deployed).

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. :-)

Categories

Resources