Im using netbeans and the application is deployed in tomcat localhost:8080.
But when I try to test the web services, I'm getting the following error message.
Webpage is opening in localhost:8080 as well. Please find the screenshot below.
Application Config file is updated as below,
public class ApplicationConfig extends ResourceConfig {
public ApplicationConfig() {
register(com.test.serverdetails.camrnvcenter.ServerInventoryRestful.class);
register(com.dso.selfhealing.vmreset.VmController.class);
register(com.dso.initiative.InitiativeController.class);
}
Related
I am using wildfly 9 and Java 1.8 to deploy a simple SOAP webservice. Here is my code
public class Hello {
#WebMethod
public String sayHello(String name) {
return "Hello" + name;
}
}
When I deploy this in wildfly I cant see this under subsytems>undertow and when i try to access my wsdl using the url http://hostname:port/contextroot/Hello?wsdl as shown in my web.xml I get HTTP 404. My web.xml is empty with just element.
Not sure whats missing and why wildfly doesnt recognise my webservice and why I get 404 error.
I am facing problem in calling webservice in my project which is deployed in weblogic, but the same application works fine in tomcat deployment.
Error:
javax.xml.ws.WebServiceException: Failed to access the WSDL at: XXXservices?wsdl. It failed with:
Response: '401: Unauthorized' for url: '://xxx.xxx.xxx.xx:8111/xxx/services?wsdl'.
But same works fine in Tomcat deployment.
I search in the net. people said, we need to force weblogic to use sun http handler, so written something like below. but its not works for me.
sun.net.www.protocol.http.Handler handler = new sun.net.www.protocol.http.Handler();
URL wsdlURL = new URL(null, "http://xxx.xxx.xxx.xx:8111/xxx/services?wsdl", handler);
HttpResponse code 401 denotes that authorization has been refused for the credentials. By default, Weblogic has basic authentication enabled. You can disable it as follows
Setting the enforce-valid-basic-auth-credentials Flag
To set the e enforce-valid-basic-auth-credentials flag, perform the following steps:
Add the <enforce-valid-basic-auth-credentials> element to config.xml within the <security-configuration> element :
<enforce-valid-basic-auth-credentials>
false
</enforce-valid-basic-auth-credentials>
Start or restart all of the servers in the domain. Please go through this link for good understanding
I have IIS (localhost:443) and Tomcat (localhost:8080) both running on my local machine. The Tomcat contains Java web services and I can remotely debug it in Eclipse IDE. I have an application installed in my IIS and when I access the page of that application, it requests a web service in Tomcat.
The problem is that when I try to load the page (the one deployed in IIS), my Eclipse won't go to the break point, meaning no request was retrieved on the Tomcat side.
But when I try to execute a request using SoapUI, Tomcat receives it and it enters my breakpoint in Eclipse. (meaning that the web services are accessible)
I cannot debug the application in IIS so I cannot determine why it can't call the web service.
Do I need to setup Windows Firewall for it? I'm just running those apps in my local machine.
Any ideas?
I got it working. My problem was permission issues in c:\windows\temp directory. I found my answer here http://nishantrana.wordpress.com/2008/02/06/unable-to-generate-a-temporary-class-result1-error-cs2001-source-file-cwindowstempfilenamecs-could-not-be-found-error-cs2008-no-inputs-specified/
I am having problems to get a #WebServiceProvider web service deployed in Glassfish 3.1.2.
I configured the glassfish-ejb-jar.xml the following way for my service.
<ejb>
<ejb-name>TestWebService</ejb-name>
<webservice-endpoint>
<port-component-name>TestWebService</port-component-name>
<endpoint-address-uri>HEAD/TestWebService</endpoint-address-uri>
<transport-guarantee>NONE</transport-guarantee>
</webservice-endpoint>
</ejb>
The web service is implemented as follows.
package test.ws.services;
import [...left out for brevity...]
#WebServiceProvider(
targetNamespace = "http://ws.test.com"
, serviceName = "HEAD/TestWebService"
, portName = "TestServicePort")
#ServiceMode(value = Service.Mode.PAYLOAD)
#Stateless
#HandlerChain(file = "test_handlers.xml")
#Interceptors({ TestInterceptor.class })
public class TestWebService implements Provider<Source> {
#WebMethod
public Source invoke(Source request) {
return calcResponseSource(request);
}
}
When starting the glassfish server the following error is shown in the glassfish server.log.
SEVERE javax.enterprise.system.tools.deployment.org.glassfish.deployment.common DPL5041:Unknown port-component-name TestWebServiceService port, all sub elements will be ignored
WARNING javax.enterprise.system.tools.deployment.org.glassfish.deployment.common DPL8007: Unsupported deployment descriptors element endpoint-address-uri value HEAD/TestWebService
WARNING javax.enterprise.system.tools.deployment.org.glassfish.deployment.common DPL8007: Unsupported deployment descriptors element transport-guarantee value NONE
Later on the service gets deployed at a "technical" URL showing the fully qualified class name.
INFO javax.enterprise.webservices.org.glassfish.webservices WS00019: EJB Endpoint deployed
server listening at address at http://test:10280/HEAD/TestWebService/test.ws.services.TestWebService
I searched the web, but could not find any solution for setting up the glassfish server to do a deployment without errors.
PS: This problem also seems to stop me from enabling HTTPS for the web service.
Regards
Egbert
I tried to deploy in GlassFish JAX-WS web service,
Here is a snippet of class were the web service is defined. Pay attention that I implemented Provider interface on EJB endpoint.
#Stateless(name = "HelloWorldEJBWS")
#WebServiceProvider(
portName = "HelloWorldWSPort",
serviceName = "HelloWorldWSService",
targetNamespace = "http://ivan.com/",
wsdlLocation ="HelloWorldEJBProvider.wsdl")
#ServiceMode(value = Service.Mode.PAYLOAD)
public class HelloWorldEJBWS implements Provider<Source> {
public Source invoke(final Source inRequestMessage) {
...
}
}
The problem is about the deploying the service in GlassFish (3.1.2.2) . F.
[#|2012-09-08T16:39:15.682-0400|INFO|glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=20;_ThreadName=Thread-2;|EJB5181:Portable JNDI names for EJB HelloWorldEJBWS: [java:global/JAX-WS_GreetingEJBMutualAuthProvider/HelloWorldEJBWS, java:global/JAX-WS_GreetingEJBMutualAuthProvider/HelloWorldEJBWS!javax.xml.ws.Provider]|#]
[#|2012-09-08T16:39:15.792-0400|INFO|glassfish3.1.2|javax.enterprise.webservices.org.glassfish.webservices|_ThreadID=20;_ThreadName=Thread-2;|WS00019: EJB Endpoint deployed
JAX-WS_GreetingEJBMutualAuthProvider listening at address at http://ABRAMOV1:8088/HelloWorldWSService/com.ivan.wsejb.provider.HelloWorldEJBWS|#]
Even it shows the endpoint is deployed - is not . I can't reach this endpoint and it is not shown in GlassFish console.
For comparison I provide the log when I deployed the service using #WebService but not #WebServiceProvider
[#|2012-09-08T16:41:50.514-0400|INFO|glassfish3.1.2|javax.enterprise.webservices.org.glassfish.webservices|_ThreadID=22;_ThreadName=Thread-2;|WS00019: EJB Endpoint deployed
JAX-WS_GreetingEJBMutualAuth listening at address at http://ABRAMOV1:8088/HelloWorldEJBWSService/HelloWorldEJBWS|#]
In this case endpoint deployed correctly and everything is working fine.
Here is snipped of the code when I apply #WebService
#Stateless(name = "HelloWorldEJBWS")
#WebService()
public class HelloWorldEJBWS {
public String hello(final String inMessage) {
...
}
}
Did I do something wrong ?
I did everything right but was mislead by GlassFish. It could be a a bug...
When I deploy web service with endpoint implemented as servlet (second case) in the console I can see endpoint, but in case with endpoint implemented as EJB the endpoint did not appear in the console. But I could access the WSDL with a link http://localhost:8088/HelloWorldWSService/com.ivan.wsejb.provider.HelloWorldEJBWS?wsdl and ultimately tested web service with the client