Worklight: Webservice inside customization WAR - web-services

Is it possible we can create Webservice inside Worklight customization WAR file? Purpose is to give access to an external application user some resources like adapters from worklight.

It may be possible but I don't think I would suggest it. Write your webservice to run independently of Worklight. Adapters can still connect to your web service even if the web service runs on an entirely separate server.
Let the Worklight WAR be Worklight and let the web service be a web service.

Related

Is there a way to find out if a updated a service in WSO2 application server?

I have a simple question if it make sense in the context of WSO2 Application server.
I want to write a module, which tells me if i updated a service. The service is an axis2 SOAP service. I know how to write modules for axis2 services inside axis2 engine. But if i use the WSO2 interface, and either delete a service, update a service or add a service, Is there a way to find out that i performed these activities?.
In short, can i intercept the messages that i uploaded a new module or i uploaded a new service or i changed the service.
thanks you...
You could write a Axis2 Observer for this, take a look http://asanka.abeysinghe.org/2008/10/how-to-writing-axis2-observer.html

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.

Do I need a web service in this case? When do we use them?

my issue is about web services and all the stuff around that. I've developed a java web app, using hibernate (to connect with a mysql DB), jsf and primefaces. The only thing I have to show to the user is the index.xhtml which will search a data in a database. All of this is running on my PC with my local apache server.
But a doubt comes to my mind when I wonder if I deploy this web app in the apache server of the company, do we need something such as a web service o something like that o they just can access to the index.xhtml and start the queries?
Sorry for this but I'm totally new repesct web services, web app, web server and all these stuff.
PS. So, when do we use web services? and web server?
Thanks in advance :)
A web service is typically used as an API that might be integrated into another application. For example, if you have a way to accept payment information. You could make that a web service that would let some other application (e.g. an auction site) make calls into your web service to do some work.
Think of it a bit like a DLL that is accessible on the web. It won't have an interface, it is a collection of methods that either return data or execute some code. It will not return a UI.
So when you use a web service would be a similar question to when you need to break code out into a separate assembly.
On your specific question above, you would not need a web service, if your web application is doing everything you need it to do, then all you need is a web application.

Strategy to develop a web service in JAX WS

i'd like your help to designing a wb serice but I don't know how i can't do this.
In fact my application handles data management clients. My application is developped in struts 1.0, spring, weblogic and build-in maven.
He was asked to me to make an evolution because an external application need to access data such as displaying the address of the client or displaying data bank. For this, it was planned to create a web service to retrieve in real time.
I would like to know the strategy to use for designing a web service. Do I need to create a new Dynamite projet maven + JAX WS to my web service and deploy my war on my weblogic server?
Or they have something else to do ?
Thanks a lot !
I am not sure that this question is related to maven.
Adding a WebService (or RestService) could be quite easy with springframework and apache cxf (http://cxf.apache.org/)
see jaxws or jaxrs for more.
create web service in a two types but real time applications using jax-ws web services reason for consumer want to send data into provider.consumer can know the entire information about the provider by seeing its WSDL Document.

Best way to deploy a web site alongside an axis2 web service via Tomcat?

I am using Axis2 (1.5.3 currently) and Tomcat (6.0.26 currently) and am running a web service. I would like to also host HTML pages for configuring the web service.
What is the best way to go about this? I assume keeping the same context is key, but perhaps it is not.
My current distribution is located under a folder structure similar to this:
Tomcat/webapps/mycompany
With the actual service code here:
Tomcat/webapps/mycompany/WEB-INF/services/myService
In a browser, I can hit my web service by going to here:
/mycompany/services/myService
I note that I can drop actual HTML files in this path and Tomcat will, indeed serve them up.
For instance, if I put "index.html" under Tomcat/webapps/mycompany, I can navigate to /mycompany/index.html and see my html.
What I want to do is have this HTML be attached to JAR/class files that can interact with the already-existing service class files in the same context as the service. Therefore, I can have the browser configure the web service directly.
Is this possible, and is there a tutorial or something out there that will help me with this? Note that I have been working with Tomcat and Axis2 for a while now for this particular web service, but I have never actually deployed a web application/html using Tomcat before.
Thanks.
First of all what do you mean by a configuring a service. Normally in SOA world services are analogous to interfaces. IMHO you can just change a service, since their are other users that rely on the services you are exposing.
If i want to change a service i would rather introduce a new version of the service after deprecating the existing one.
Are you talking about applying QoS to existing serviecs. Then that makes sense.
Anyway, If you want to have a web-app alongside with axis2 service engine, it is possible. If you look inside the axis2 war file you'll find the web.xml entry to Axis2Servlet. It is this servlet that serves the web services requests.
So, what you need is the Axis2Servlet mapping in your web-app along with your usual servlet-mappings. Number of possible ways to configure your services using web-app files. One options is to use web-services call itself to (with authentication) to configure it.
By "configure a service", take this example:
The service has a set of datasets.
Each dataset exists in a separate database.
The service can manage 0..n datasets.
The service must be configured to know about each dataset.
This is what I'm configuring. I'm not trying to configure Axis itself or redefine the service.
I would like to host the HTML using the same instance of Tomcat that I'm hosting the web service with. It needs to manage sessions, have login capability, an whatnot, and has to be able to configure the web service live.
From what I'm reading, it's probably best to make an interface to the web service that the web application module can call into from a different context.
Is there a better way?