Use of the webservice protocol of dubbo
Common interface and implementation class
Public interface WsService
{
String sayHello (String msg)
}
Public class WsServiceImpl implements WsService
{
@ Override
Public String sayHello (String msg)
{
Return "hello" + msg
}
}
Dubbo service provider configuration
Dubbo service consumer configuration
Web.xml configuration
Dubbo
Com.alibaba.dubbo.remoting.http.servlet.DispatcherServlet
one
Dubbo
/ *
Dependent profile
Org.apache.cxf
Cxf-rt-frontend-simple
2.6.1
Org.apache.cxf
Cxf-rt-transports-http
2.6.1
Matters needing attention
It needs to be specified.
Jar needs to use version 2.6.1, but there seems to be a problem with the higher version. Consumers can't access it.
When consumer references, the url needs to take the application context, otherwise it cannot be accessed.
For servlet services, the port and context must be consistent with the application server's port and context.
Remaining problems
Mutual use of 1.dubbo-webservice and Standard webservice