The change from RPC to Document style is not so big. Axis2 also supports RPC, 
but by building the clientstub code with xmlbeans you can use Document mode.

RPC style:
WebRequest webRequest = WebRequest.newInstance()
webRequest.set()

Document style:
WebRequestDocument webRequest = WebRequestDocument.Factory.newInstance()
webRequest.set()


Almost all subelements are equal so if you have decoupled the build of all the 
subtypes you can reuse the old code.

You need to use Factory.newInstance() instead of newInstance for all types.


Also the Document style is easier when working with simpletypes, instead of 
making converter methods for basic types to/from native javatypes
You can use set(string), set(int) on the simpletype elements.. Like this:

RPC style;
In old style you had to make converter methods from native types

        textType.setTextType(TextType type)

    private TextType generateTextTypeFromString(String input) {
        TextType textType = TextType.newInstance();
        textType.setTextType(inndata);

        return textType;
    }

Document style:
In document style you can use String, Integer etc directly.

        accessType.setConfigName(String type);


I don't know if this was a good answer, but I recently converted to Document 
style because ADB RPC style did not handle empty tags on this form : <tag/>
With the document model I both get an easier way to write the client and it 
handles responses better.

Regards,
Tomas Andersen


From: JERIL NADAR <jeril842...@gmail.com<mailto:jeril842...@gmail.com>>
Reply-To: "java-user@axis.apache.org<mailto:java-user@axis.apache.org>" 
<java-user@axis.apache.org<mailto:java-user@axis.apache.org>>
Date: Friday 5 December 2014 13:33
To: "java-user@axis.apache.org<mailto:java-user@axis.apache.org>" 
<java-user@axis.apache.org<mailto:java-user@axis.apache.org>>
Subject: Axis 1.4.2 to Axis2 1.6 Migration

Hi,
I got your mail id from your Axis migration page : 
http://axis.apache.org/axis2/java/core/docs/migration.html
I have one quick question for you. Your help would be highly appreciated.
Our project receives Webservice response from an external system.
We have webservice clients written to send the request and receive the 
response/fault message accordingly.
Till recently they were using Axis 1.4.2 but now are planning to move to Axis2 
1.6.
They are ready with the Webservice part and have shared their WSDL file.
The operations remains the same but now they have moved from RPC style to 
Document style.

So my question is  if we continue to remain with the older client (axis 1.4.2) 
will it make any difference?
If yes, what changes would be required from our side for the client code?

Any help would be useful.



--
Thanks,
Jeril Nadar
John 3:16



Reply via email to