I am developing a Java desktop application and I want to consume a web service in it. The web service requires two-way SSL connection with message level security using binarysecuritytoken. I am using NetBeans IDE 6.9.1 with JDK 1.6.0.23 and JAX-WS as ws wrapper. How can I communicate with the ws without using any web server on client machine. Most of the stuff I read needs to have tomcat or some other web server on client machine (configuring the keystore in tomcat or so...). Is it possible to do? Please suggest some article for SSL based ws client for Java desktop application.
Consuming web services in JavaSE - see NetBeans tutorial
Use BindingProvider to set your properties before you invoke the service. See example of using BindingProvider here
Related
I currently have web services written in .NET being hosted on a Windows 2012 server with IIS 8. The .Net services were written by someone else. My experience is mostly in Java so I figured I'd write my web services in Java. Now I'd like to host the Java web services on the same server. I know I can't use Java web services directly in IIS 8 but is there a way to have Tomcat hosted through IIS 8 and then have the Java web services routed through IIS 8 to Tomcat? I've seen the Tomcat connectors being used but the main thing I want to do is host both Java and .Net web services.
Is this possible and if so, how?
Both IIS and tomcat are web application servers. When they work, what they do is to listen to http requests on some specific port and handle them. So, as long as they are configured on different ports, there should be no problems.
I am making a program all written in Java. Server is Spring Boot RESTful and client is an desktop app made with JavaFX that uses Apache HttpClient library to communicate to the server. Now I need to secure it with SSL/TLS. I am interested in the implementation itself and also whether a self signed certificate is enough since the program will be used only in LAN.
I have web service which i built using apache axis2 and java w/ eclipse. I have also implemented a web service client. I ran the client as a java app in eclipse and it works perfectly with the web service. But now i want to run it as a web-based client. When i deployed, it is trying to use the default port(8080) of tomcat. But that port is already in use by the web service. So how do I run deploy my client on a different port from eclipse.
you hosted the service and client in two different tomcat instances which are running in port 8080? change one instance's port ..
I'm trying to write a simple java client for starting/stopping application deployed on Tomcat using Tomcat JMX Proxy. Tomcat's documentation here http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Using_the_JMX_Proxy_Servlet helps, however I can not pin down the exact piece of code doing that. Any help will be appreciated.
Can Java (JAX-WS) host "web" service in desktop program?
For example .net wcf can host services anywhere.
Tnx all.
This should be possible using the javax.xml.ws.Endpoint class (and the server from the JDK). You can learn more about this in the following article.
Another option would be to use an embeddable container like Jetty, to embed it in your desktop app and to deploy your JAX-WS web services on it.
As long as there is a tool to handle HTTP - yes. Jetty can be embedded in desktop applications. Here is some documentation about standalone http transport with cxf.