Glassfish 3.1.2.2: #WebServiceProvider deployment fails: DPL5041 : Unknown port-component-name - web-services

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

Related

Wildfly 9 Stateless session bean webservice not showing up in Web Service Endpoints

I'm quite new to the Wildfly server.
Currently I'm trying to expose a simple Stateless Session Bean as web service. I don't want to use the webModule to define servlet mappings for the web services beans. I want to keep that seperated.
I just want to expose a simple Stateless Session Bean as web service.
I used the wildfly-javaee7-webapp-ear-blank-archetype as starting point.
In the ejbModule i added a Stateless Session Bean with #WebService annotation.
The ejbModule is packaged in an .ear file, which is deployed to the WildFly Server 9. The deployment shows now error message.
I now expected to see some endpoints in the admin console under web service endpoints as the documentation(https://docs.jboss.org/author/display/WFLY9/JAX-WS+User+Guide) says. But I can't see any endpoints.
What I'm doing wrong ?
How can i access the generated WSDL file of the web service ?
What is the exact context root when ejb is packaged inside ear file?
Any hints are appreciated.
package eu.sample.testws.service;
import javax.ejb.Stateless;
import javax.jws.WebService;
/**
* Session Bean implementation class TestWSBean
*/
#Stateless
#WebService(serviceName="TestWSService", name="TestWSServiceName", portName="TestWSPortName", targetNamespace="http://sample.eu")
public class TestWSBean {
/**
* Default constructor.
*/
public TestWSBean() {
// TODO Auto-generated constructor stub
}
public String sayHello(){
return "Hello";
}
}

Not able to invoke axis2 service from wso2 ESB proxy service

I am new to OSB.
-> I have a AXIS2 webservice application running on wso2 appserver. If we pass a name as a parameter it will return hello + Name.
-> I am trying to access this application from proxyservice in WSO2 ESB application.
The project name is SampleESBConfig and proxy service name: ESBtoAxis2PS1
Steps for Implementing proxy service:
The proxy service ha wsdl url : http://localhost:9763/services/Test1?wsdl ; Wsdl Type: SOURCE_URL
InFlow
Placed LogMediator
place SendMediator
Created address endpoint which points to : http://localhost:9763/services/Test1 [ Target URL, AXIS2 webservice application URL]
OutFlow
Placed LogMediator
place SendMediator
Fault Sequence
Placed the LogMediator
Created Composite application which includes the above proxyservice
Deployed this application on WSO2 ESB server which is running on localhost.
Note:
Both ESB & appserver running on localhost
When i am trying to test the application getting the below error.
[2015-06-18 16:27:55,212] ERROR - Axis2Sender Unexpected error during
sending message out org.apache.axis2.AxisFault: The system cannot
infer the transport information from the
/services/ESBtoAxis2PS1.ESBtoAxis2PS1HttpSoap11Endpoint URL.
How do I fix this?
Let assume that your are calling the echo proxy and you are creating a soap project by providing the wsdl of your proxy service.Then the request url for echo service will be
http://localhost:8280/services/echo.echoHttpSoap11Endpoint and when you are going to invoke it, you will get the above error.
As a solution for it you need to remove the part behind the "." operator. So you proxy calling url will be http://localhost:8280/services/echo
According to the error log I found that you are calling the proxy service /services/ESBtoAxis2PS1.ESBtoAxis2PS1HttpSoap11Endpoint . So you need to call the proxy like /services/ESBtoAxis2PS1 as I mentioned earlier.
Hope this may solve the issue.

JMETER: how to exclude proxy

I've a web service built on WSO02 that run in a virtual machine running on my laptop.
My laptop IP: 10.118.xx.yyy
My web service wsdl: http://192.168.zz.kkk/wso001/services/OperCupPrepareProxy?wsdl (NOTE: 192.168.29.128 is the IP of my WSO2 ESB on my virtual machine)
I can invoke my web service using SOAP UI running directly on my laptop (i.e NOT running in the virtual machine ...), with NO proxy setting and all it's working right
Now I'd like to test my web service using JMeter running directly on my laptop (i.e NOT running in the virtual machine ...), and invoking the web service that run inside the virtual machine with WSO2.
JMETER respond ....
Response code: 500
Response message: Internal Server Error
<faultstring>The endpoint reference (EPR) for the Operation not found is /wso001/services/OperCupPrepareService?wsdl and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.</faultstring>
How can I set my JMETER to invoke my web service?
Thank in advance
Cesare

Weblogic deployed application calling webservice not working, but in Tomcat deployment works fine

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

Cannot deploy web service in GlassFish using together #WebserviceProvider and #Stateless

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