I am using WebSphere to publish my service as a web service using #WebService annotation in eclipse.
Details of the server :
Product name: WebSphere Application Server
Product Version: 17.0.0.2
Product edition: BASE_ILAN
While deploying the project on the server, the project started successfully and now I wanted to see the generated WSDL through admin console(as I do in Glassfish).But I am not finding any way to view the admin console or any directory which is having the generated WSDL(I am using mac os)
However, I can see(in eclipse) my service is deployed successfully, see attached image:
Thanks in advance.
As far as I know it's not available in the admin center however you can retrieve it from the service using a web browser.
Look in messages.log to find the context root of your webservices app, you'll see something like:
Web application available (default_host): http://localhost:29080/hello_jaxws/
Then to find the service you might need to know a bit about the service. If the name of the service isn't in an #WebService annotation, and the class isn't remapped in web.xml, then it's the name of the class + "Service". So in my case the name of the class is HelloService, so the url to my service is
http://localhost:29080/hello_jaxws/HelloServiceService
A browser should return
Hello! This is a CXF Web Service from that url.
Finally, add ?wsdl to it to get the wsdl
http://localhost:29080/hello_jaxws/HelloServiceService?wsdl
You can find it also when you navigate to {your service} -> Service providers -> {your service} -> WSDL document (from additional properties).
Look there for "soap:address" element, and copy the "location" value/address to your browser with anding "?wsdl" to the end of it.
Related
So i am trying to deploy new version of SOAP service with different version.
In jboss-webservices.xml I have configured url to service as:
<context-root>/services/MyService</context/root>
<port-component>
<ejb-name>MyServiceEJB</ejb-name>
<port-component-uri>v1</port-component-uri>
...
</port-component>
When I try to deploy service v2 with <port-component-uri>v2</port-component-uri> it ends up with duplicate deployment error because of same context root.
So I tried it with <context-root>/services/MyService/v2</context-root> and <port-component-uri>/</port-conponent-uri>. This solution actually works. But the wsdl is at location : https://MyServer.com:8443/services/MyService/v2/?wsdl.
Is there any solution to be the wsdl at https://MyServer.com:8443/services/MyService/v2?wsdl ? Without the "/" before the "?wsdl".
Basically I want to have deployed both versions of application, where both has url https://MyServer.com:8443/services/MyService/v1 and second https://MyServer.com:8443/services/MyService/v2, but without touching the context-root element.
Thanks for any tips.
I am about to create a backend for a web application with Java servlets for a REST Api only, which should base on
Java 11
Maven
Tomcat 9 (externally to project)
JAX-RS
Jersey
Then I am using Eclipse and I have created a dynamic web project and converted it to a Maven project.
Some problems in the project / folder structure might be caused by this. Here is the structure:
When I let the server run and hit localhost:8080/hello_world I can see the index.html in the browser.
I actually have two question:
Having a real WebContent is wrong, isn't it? I should have a real webapps folder, but the WebContent folder should be virtual (from Eclipse), right?
How can I separate the index.html and or at least all other frontend resources (HTML, CSS, JS (React.js etc. pp.)) to a separate folder for heaving one repository for the Java Web Servcice and another one for the frontend? Is this impossible with this tech stack?
I believe that your web service URL is not complete and you have to check your web.xml url-pattern tag and the Path annotation you have defined for your services.
In order to have a better prospect of Restful web services in Eclipse IDE, I suggest you follow these HelloWorld examples (simple hello world rest service and CRUD web services using jersey) to widen your horizon about some configurations in web.xml in which you have to define your container to your application server and corresponding pom.xml for jersey dependencies.
it is ok to have the WebContent folder in Dynamic Web Applications and there is nothing wrong with your project / folder structure
We have a web based application with Front end in Angular JS 1 and REST service with Spring jersey frame work.We are using Spring 3.We have deployed our project in Tomcat 9.We have deployed angular js part as a separate project and REST service is build as a war file and deployed separately.
Suppose our application url is https://10.100.200.300:8443/DEMO.When we are trying to access the URL with a wrong value say https://10.100.200.300:8443/DEMO_TEST we are getting the error 404 i.e. resource not found by the tomcat server.We want to show some customized error page for 404 or any other tomcat error. Please suggest how to do it?
You can have a look here - Configure spring boot to redirect 404 to a single page app
Make spring configuration as mentioned in above answer and reroute it to your desired page.
I am trying to run examples provided at TomEE example website : https://tomee.apache.org/examples-trunk/simple-webservice/README.html. But when I start the application with TomEE, I am not able to hit the wsdl URL. It doesn't find the resource. In console also, I can't see the webservice entry.
Can anyone please help with what could be wrong with my approach?
This is a jar? Set packaging to war and deploy the war. Wsdl will be accessible adding ?_wsdl to the logged url during startup.
I'm using Openfire as the chat server for my company. And now I need to create a plugin for Openfire.
As I can see from other plugins, they can have HTTP binding to themself through port 7070.
For example: http://example.com:7070/redfire where redfire is the name of the plugin.
The name of my plugin is toplug, so I want to be able to access the JSP pages of my plugin through: http://example.com:7070/toplug/index.jsp where 'index.jsp' is some example page.
But when I try to access my JSP pages through port 7070, the Jetty server (on which Openfire runs) always reports error 404 'page not found'. I guess this is because the binding to my folder which contains JSP pages hasn't been set. How to do this binding thing please?
The question is answered here:
http://community.igniterealtime.org/message/224134
You do not need a plugin to access the web service for the http bing port. Just put your web pages in a folder under:
OPENFIRE_HOME/openfire/resources/spank
and access with:
http://example.com:7070/your_folder/your_page.html
Note that Openfire does not compile JSP pages unless you replace jasper-xxxx.jar files in the lib folder.
If you still want to create a jetty web context (application) from your plugin, see source code of Redfire plugin:
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.eclipse.jetty.webapp.WebAppContext;
...
public void initializePlugin(PluginManager manager,File pluginDirectory) {
ContextHandlerCollection contexts =
HttpBindManager.getInstance().getContexts();
context = new WebAppContext(contexts,pluginDirectory.getPath(),"/"+NAME);
context.setWelcomeFiles(new String[]{"index.html"});
...