WebService-based remote calling protocol,base on Apache CXF frontend-simple
and transports-http
implements。
Interoperable with native WebService services:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-simple</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>2.6.1</version>
</dependency>
Serializable
interfaceconfigure webservice protocol:
<dubbo:protocol name="webservice" port="8080" server="jetty" />
configure provider level default protocol:
<dubbo:provider protocol="webservice" />
configure service level default protocol:
<dubbo:service protocol="webservice" />
configure multiple port:
<dubbo:protocol id="webservice1" name="webservice" port="8080" />
<dubbo:protocol id="webservice2" name="webservice" port="8081" />
configure direct connect mode:
<dubbo:reference id="helloService" interface="HelloWorld" url="webservice://10.20.153.10:8080/com.foo.HelloWorld" />
WSDL:
http://10.20.153.10:8080/com.foo.HelloWorld?wsdl
Jetty Server (Default):
<dubbo:protocol ... server="jetty" />
Servlet Bridge Server (recommend):
<dubbo:protocol ... server="servlet" />
configure DispatcherServlet:
<servlet>
<servlet-name>dubbo</servlet-name>
<servlet-class>org.apache.dubbo.remoting.http.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dubbo</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Note that if you use servlets to dispatch requests:
<dubbo:protocol port="8080" />
must same as servlet container’s.<dubbo:protocol contextpath="foo" />
must same as servlet application’s.