Recently, ProcessMaker and ProcessMaker2.5 are WebServices released in php. Therefore, java cxf is required to call php webservice. To understand WebService, the key is wsdl. Step 1: blog.163.comkangle0925 @ 126blogstatic27758198201363111718168) 1. First
Recently, ProcessMaker 2.5 is a webservice released by php. Therefore, java cxf is required to call php webservice. The key to understanding Web Services is wsdl. Step 1: http://blog.163.com/kangle0925@126/blog/static/27758198201363111718168) 1. First
Recently, ProcessMaker 2.5 is a webservice released by php. Therefore, java cxf is required to call php webservice.
The key to understanding Web Services is wsdl.
Step 1:Http://blog.163.com/kangle0925@126/blog/static/27758198201363111718168)
1. Download The cxf package: http://cxf.apache.org/download.html. now cxf package.
2. decompress the package and run the cmd command to enter the bin directory.
3. Use the wsdl2java command to generate client code
Run wsdl2java-p com. winssage. demo. service-d: \ pmws-clientd: \ pmws \ wsdl2.xml on the command line (you only need to generate the WebService client-related code)
Wsdl2java usage:
Wsdl2java-p com-d src-all aa. wsdl
-P specifies the wsdl namespace, that is, the package name of the Code to be generated:
-D specifies the directory where the code to be generated is located
-The client generates the code for the client to test the web service.
-The server generates the code for the server to start the web service.
-Impl: generate the web service implementation code
-Ant generate the build. xml file
-All: generate all the starting endpoint code: types, service proxy, service interface, server mainline, client mainline, implementation object, and an Ant build. xml file.
Step 2: Modify the bean configuration file of cxf (spring integration)
Factory-bean = "wsSampleClientFactory" factory-method = "create"/>
ProcessMakerServiceSoap: the webservice interface Class (interface) generated from the wsdl must be assigned to the serviceClass attribute of the factory class org. apache. cxf. jaxws. JaxWsProxyFactoryBean.
The address attribute of the factory class org. apache. cxf. jaxws. JaxWsProxyFactoryBean must be taken from the service configuration in the wsdl. xml file, as shown below:
ProcessMaker Web Service
Solution:A class/interface with the same name "XXX **" is already in use.
Http://chenlin10058.iteye.com/blog/1558591)
1. Use-autoNameResolution for Automatic Processing
Wsdl2java-autoNameResolution http: // localhost: 8060/soa/services/otherTrackedVehicleSoapService? Wsdl
Or
Wsimport-p com. test. client-keep http: // localhost: 8060/soa/services/otherTrackedVehicleSoapService? Wsdl-B-XautoNameResolution
Troubleshooting: Super code compilation error:
- // ThisConstructorRequiresJAX-WSAPI2.2.YouWillNeedToEndorseThe2.2
- // APIJarOrRe-runWsdl2javaWith"-FrontendJaxws21"ToGenerateJAX-WS2.1
- // CompliantCodeInstead.
- PublicIcpBusinessService (WebServiceFeature...Features){
- Super (WSDL_LOCATION,SERVICE,Features );
- }
-
- // ThisConstructorRequiresJAX-WSAPI2.2.YouWillNeedToEndorseThe2.2
- // APIJarOrRe-runWsdl2javaWith"-FrontendJaxws21"ToGenerateJAX-WS2.1
- // CompliantCodeInstead.
- PublicIcpBusinessService (URLWsdlLocation,WebServiceFeature...Features){
- Super (wsdlLocation,SERVICE,Features );
- }
-
- // ThisConstructorRequiresJAX-WSAPI2.2.YouWillNeedToEndorseThe2.2
- // APIJarOrRe-runWsdl2javaWith"-FrontendJaxws21"ToGenerateJAX-WS2.1
- // CompliantCodeInstead.
- PublicIcpBusinessService (URLWsdlLocation,QNameServiceName,WebServiceFeature...Features){
- Super (wsdlLocation,ServiceName,Features );
- } $
It cannot be compiled normally because the jax-ws2.2 protocol conflicts with java6, execute the command:
Wsdl2java-frontend jaxws21-client *. xml
In this way, the code generated in the jax-ws2.1 can be compiled and executable in Java 6.