Posts

Showing posts from May, 2018

Dynamic WS Clients. Eureka! 2. How-to in Java

0. Introduction In the last post we got information about: Fully qualified names of classes The structures (classes) used in the WS for input and output. 1. The pom.xml file It is the same as the one in this elder post . The important thing is using Apache CXF libraries ("cxf-rt-frontent-jaxws", "cxf-rt-transports-http" and "cxf-rt-transports-http-jetty") 2. Simple scaffolding(1): Accessing the WSDL  This is as simple as this 2 java lines of code: // 0.Package declarations import org.apache.cxf.endpoint.Client; import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory; ... // 1. Declare WSDL JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory. newInstance (); Client client = dcf. createClient ( "http://XXX.XXX.XX.XX:8080/gexflow/ws/Registro_v2.0?wsdl" ); Here the "XXX.XXX.XX.XX" represents the WS server IP address. 3. Simple scaffolding(2): Creating the WS needed classes and

Dynamic WS Clients. Eureka! 1. Getting Information from the WSDL

0. Introduction It has been a hard work for me achieving this goal. I have been trying to find free and simple WS on the web to help me implement dynamic WS clients. I have been googling around and finally, this simple web service was near me. "Gexflow" offers a lot of simple and easy WS. I have been looking around to find easy examples of dynamic WS clients and none of the satisfied my needs. After reading this official post for Apache CXF and bit of practice I can say Eureka! Now I want to convert my application from static WS client to dynamic WS client. Now I do not need all the scaffolding of classes generated with Apache CXF command " wsdl2java " that by the moment needs Java 8. Let's begin understanding the WSDL and selecting the WS we need. We are going to focus on the operation " registrarAsientoEntrada " that means inserting a row in the "entrance record". 1. Getting information from the WSDL Here is the informatio