Web application and web service as a client of another web service - web-services

If I use a standalone application to interact with a Restful web service I use Apache HttpClient or its Fluent API.
How do I interact with a web service using a web application or from another Restful web service?
Do I again go back to Apache HttpClient?

A web service client is a web service client, no matter if who's doing the consuming is a standalone application, a web application or even another web service. You could consume them how you see fit:
use a JAX-RS aware client like the RESTEasy client framework (I see from your profile you are using JAX-RS);
use a (generic) REST aware client like Resty;
use Apache HTTPClient;
heck, you could even use java.net.URL :)

Related

How to consume a web service using .NET Core 2.0 Connected Services

I have created a service called GetReportService. My endpoint is http://xxx1/usa/report.asmx. I am using POST passing a parameter id123.
How do I invoke this web service using a web api in .NET Core 2.0?
I figured out that the connected service option is a WCF service so I am able to consume the service as I normally would in previous versions of .NET.
However, in .NET Core if I want to inject that service, I do have to go to the Startup.cs file and add my service in the ConfigureServices method and then inject the service into my controller.
This is a more detailed explanation of what I did:
How to inject WCF service client in ASP.Net core?

Using Apache CXF with Aegis databinding and JAX-WS front-end

I'm new to the web services. Trying to learn something related to Apache CXF. Can anyone please give me an example (along with configuration, so that it can run on any application server say Tomcat) that uses Aegis data binding with JAX-WS as front-end?
I.e. the web service should use Aegis data binding with JAX-WS as front-end. The web service client may use any binding, any front-end, or it may be a simple standalone application also.

If I can write HTTP Service in WCF, why should I use Web API?

I've gone over other WCF vs Web API question as well as blogs. It is possible to write HTTP service with webHttpBinding in WCF too. So why should one move to Web API when it is possible to use WCF for the same purpose. Some say it's easy to use HTTP in Web API. But in what sense.
A lot of blogs make me confused. Most of them are like " You can do HTTP in WCF but Web API is pure REST based. You can use Web API if you want but you can use WCF too". It's like salesman describing their product which is really confusing for me here.
I have old asmx service which I want to move to REST Service. I tried WCF with webHttpBinding. It works well but why should one move to Web API?
If you already have a WCF service that you're satisfied with, then you're done. No need for WebAPI.
You would use WebAPI if there are features of the WebAPI which WCF cannot conveniently supply. The WebAPI is "closer to HTTP", whereas WCF is a generic communications framework.

How to convert JBPM project into Web- service?

I have a working JBPM project that i want to expose as a web service so from my server i can call that web-service. So please let me know is there a any way to expose a JBPM project into a web service.
By default, you can use the jbpm-console service to expose the processes you have deployed there as a REST service. You can also expose your project yourself as a web service using for example the camel integration component (and using camel to set up a WS endpoint) or by writing a custom wrapper yourself.

Web Service on Netbeans

I have created a Web Service in Net Beans 6.9 and deploy it locally. And I am using it via a java SE application by adding Web Service client in this application. How to obtain the link of the Web Serice so that it can be used from anywhere ?
2) From where to obtain WSDL file of Web Service ?
3) How to host a Web Service on the internet ?
Thank a ton in advance..!!!
You could create a new project of type web application in Netbeans.
In the web application, you will then create a web service (NOT a web service client).
For publishing and testing the web application, you will have to deploy it to a web server (e.g. GlassFish).
After publishing the web application, the WSDL file will be typically located at: http://localhost:<port>/<your web app>/<your service>?wsdl
For GlassFish, the default port is 8080.
If your current Netbeans installation doesn't support web projects or you don't have GlassFish installed, I suggest you download and install the latest version of Netbeans with Java EE support (bundled Apache Tomcat and GlassFish server in the same setup).
http://netbeans.org/downloads/index.html
Hosting SOAP web services on the internet at large has not been terribly successful. For example Google had SOAP based web services initially, and they switched to REST based services in the end. You may want to reconsider and deploy a REST based interface. If the bulk of your code is not embedded in the web service, then you should not have that difficult of a time switching the interface.
To deploy a SOAP or a REST web service, you would need to deploy a 'full' Java EE container (e.g. Glassfissh or JBoss) on a machine with access to the internet. You might virtual hosting e.g. Westhost, Amazon, or there are turnkey solutions like Heroku (note: I'm not endorsing any of the companies listed here; they're just examples). If you just want to deploy a REST based service, any web container will do e.g. Tomcat or Jetty. In addition to services mentioned above you could probably host a rest web service on any service that will let you upload a war file.