Creating an Axis2 Web Service Client - Types Without Changing the Client

Is it possible that Axis2 and Eclipse will create a web service client and use the Java types that you already have in the packages, rather than creating your own types. Reason, of course, if I already have type A and it creates its own type A, I cannot just assign a variable of type A to a variable of type B.

wsdl is created from a web service deployed to an application server. If this cannot be generated from this, one could create a client from existing java files.

+3
source share
6 answers

, API Axis2 , wsdl2java. -. -, QName, . .

- , , API, .

serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();

EndpointReference targetEPR = new EndpointReference("http://myservice");

options.setTo(targetEPR);

QName methodName = new QName("ns","methodName");

Class<?>[] returnTypes = new Class[] { String.class };

Object[] args = new Object[] { "parameter" };

Object[] response = serviceClient.invokeBlocking(methodName, args,
                returnTypes);
+3

- wsdl, ?

, wsdl2java, wsdl, - .

wsdl, , .

A B, BeanUtils.copyProperties, A B.

+1

java webservices . , .NET/# .

, BeanUtils.copyProperties.

BR,
~

0
0

ServiceClient -, XML XML. - XML- Java-POJO . . XML Map ..

, - - -, XML. XML POJO Castor JAXB libs.

, diff. -. , . - diff. , .

//common interface for response handlers...
//implement this for diff. web service/methods
public interface WSRespHandler{
    public Object getMeResp(Object respData);
}


//pass particular handler to client when you call some WS
public class WebServiceClient {
    public Object getResp(WSRespHandler respHandler) {
        ..

        return repHandler.getMeResp(xmlData);
    }
}

:

http://www.developer.com/java/web/article.php/3863416/Using-Axis2-and-Java-for-Asynchronous-Web-Service-Invocation-on-the-Client-Side.htm

http://www.devdaily.com/blog/post/java/java-web-service-client-read-array-list/

.

www.techlads.com

0

, - -, , 2: http://axis.apache.org/axis2/java/core/docs/userguide-creatingclients.html.

, Axis2 Eclipse ADB (. http://axis.apache.org/axis2/java/core/docs/adb/adb-howto.html), -. , ( stub), Wsdl2Java:

    %AXIS2_HOME%\bin\WSDL2Java -uri <wsdl file path> -p <package name> -u

-u ADB , .

0

All Articles