I've created a Java RESTful web service using NetBeans 8.0 and GlassFish server 4.0, using my database(local). When I click the "Test RESTful web services" my default web browser opens with an alert saying:
Cannot access WADL: Please restart your RESTful application, and
refresh this page.
Note: Using the default sample database everything works fine.
Update: I'm following this tutorial https://netbeans.org/kb/docs/websvc/rest.html
try changing the version of jdk and tomcat.
in netbeans in your source package where the restful .java file is click on that file and one of the lines of code will have an error lightbulb saying that restfull is not configured properly click on that and everything will be fixed.
Related
I am taking over an old colleague's code and he used JHipster to build a Maven-Spring-Angular project.
I am able to compile, package his code and I used a simple Chrome Web Server (plugin), point it at the project's "target" folder which contains all the web components (i.e. assets, bower_components, META-INF, WEB-INF, etc) and his code, a dashboard can run successfully on the Chrome Web Server.
Problem is, all API calls to the Java back-end are failing.
IMAGE: API calls 404 error
IMAGE: Sample endpoint, api/data
Am I missing any steps when trying to run the project locally on my PC?
Will update the answer in details soon but just want to share the solution.
Chrome Web Server is not a proper Servlet Container hence Spring wasn't able to start. Since Spring did not start, requests to the endpoints could not be handled.
Essentially I am trying to create a simple SOAP Webservice in Java, Maven, and Spring.
I have tried following tutorials, books, and just hacking at it. Can anyone help please.
Background
We have a project which is effectively a bunch of libraries boiling
to a handful of interfaces.
The project is a maven project created using the spring framework,
mainly roo.
We're running the STS eclipse IDE which has a vmware (vSphere)
virtual web server.
What I'm trying to achieve
Add web services for SOAP and HTTP endpoints.
Have existing WSDLs for these web services.
What I have tried:
1. Creating a web service with "Top down Java bean Web Service" type pointing to the wsdl, VMware server.
Creates a web service project separate from my existing project.
Web Service seems to be synchronised in the virtual web server.
Right clicking to the home page for the web server results in the 404 error.
Looking at the localhost:8080 shows a running virtual web server page.
Problems:
Project created is in the eclipse workspace rather than the source folders. This results in source control commitment issues.
Is it normal for all web services to be a separate project per web service in eclipse?
Right clicking to the home page for the web server results in the 404 error.
Not sure how to debug the 404 error to determine the issue.
2. Created an SomeNameEndpoint.java file and generated a web service project from this.
Creates a web service project separate from my existing project.
Web Service seems to be synchronised in the virtual web server.
Right clicking to the home page for the web server results in the 404 error.
Looking at the localhost:8080 shows a running virtual web server page.
package shlonline.integration.endpoints;
import javax.jws.WebMethod;
import javax.jws.WebService;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
#WebService(serviceName = "myServiceName")
public class myServiceEndPoint extends SpringBeanAutowiringSupport
{
#WebMethod
public boolean runWebMethod(String input)
{
return false;
}
}
Problems:
Right clicking to the home page for the web server results in the 404 error.
Not sure how to debug the 404 error to determine the issue.
This tutorial along was really helpful for me, the project is available for github download, and uses maven and spring web services. It uses spring-ws with spring annotations of #Endpoint and #PayloadRoot annotations rather than the #WebService you have above.
http://briansjavablog.blogspot.com/2013/01/spring-web-services-tutorial.html
i am newbie to java/eclipse and also to creating web services.Now i am trying to host the web service which is created in java using eclipse.
http://www.softwareagility.gr/index.php?q=node/29
i am following the above link for my reference.
My problem is,i got struggle on after creating a web service.I have created a web service and run it through the tomcat server and its showing like the below image
this is the link of wsdl of my web service i got
"http://localhost:8080/ResourceA/services/Myservice?wsdl"
Now i need to know,what steps i want to do after these steps, to publish and run my web service through my cloud server?
Thanks in advance!..
Export the project as a Web Archive (.war file) and deploy that on the server.
i'm creating an application for java desktop. This application accessing our webserver which running RESTful and SOAP based webservice.
I'm having trouble when adding new service client in services tab in netbeans 7.1.2. When adding new RESTful webservice the netbeans always says:
"cannot determine wadl or wsdl"
What i do is placing the restful url :
http://localhost:8080/Walcoo/resources/application.wadl
into URL textfield.
How to solve this error? I've googled it, but it shows that in netbeans 6.9 it is a bug. But how about in netbeans 7.1.2?
Thank you
I am trying to create a webservice from java application.
I am using tomcat 6 server and axis2 ..i had installed axis2 and set the runtime location for axis2 inside Web services>Axis2 preferences.
This is the exception am getting when am trying to create a webservice..
Exception occurred while reading or writing file {0}The Axis2 facets cannot be installed since the Axis2 runtime location has not been set.
Please go to the Web Services preference page and set the Axis2 runtime location under Axis2 Preferences.
Can anyone give a solution for this?
If u have set axis 2 preferences properly then i think u have not set the configuration properly while creating the project in eclipse.
Follow the below steps..
In eclipse go to File- New- Dynamic Web Project..
In configuration select custom and modify..
Check the Axis2 Web Services and click OK..
Follow normal steps afterwards.. It should work now....
Create a dummy dynamic webproject with axis2 feature and ,
then try the old project of yours
Go to your services java file and
right click and choose webservices -->
create webservice -->
choose webservice runtime to axis2 -->
and continue it should work now