Migrating from Axis 1.1 to Axis 1.2
by Simon Fell on June 8, 2005 at 09:59 AM
Now that Axis 1.2 is GA, you might be tempted to move from your Sforce integrations from Axis 1.1 to Axis 1.2 (or if you're trying to move to Java 5.0, Axis 1.1 doesn't really work well with Java 5.0), if so here's a few of the gotchas you'll run into.
- Axis no longer generates a wrapper class for simple type restrictions, this means that the ID class disappears, ID is now treated as a plain jane String.
- The naming convention for some classes changed, mainly those that used to get a leading _ in the name no longer do, so _SessionHeader is now just SessionHeader
- For the Partner WSDL, query & retrieve calls that have null field values, will now correctly populate a null value in the Any array, however if you include Id in your field list, this will not appear in the Any collection (this is a bug in 1.2 that looks like it'll be fixed in the upcoming Axis 1.2.1 release). This means the Any array will 1 smaller than you expect if you include Id in the field list.
There's a number of bug fixes, the most noticeable one, is that it correctly handles arrays of subclasses of SObject, so in the Enterprise WSDL, you can create and pass an Account [] directly to create or update, you don't need to pass an array of SObjects, where each SObject is of type account, e.g. you can do
Account [] a = new Account{1};
a[0] = new Account();
...
proxy.create(a);
rather than having to do
SObject [] a = new SObject[1];
Account act = new Account();
...
a[0] = act;
proxy.create(a);
On the downside, the enormous amounts of memory requires to parse a Partner WSDL response that includes lots of fields is still there, If you're querying all fields via the Partner WSDL, be aware that your process can require large amounts of memory while parsing the response, if you started the VM without a large enough heap size this can lead to Out Of Memory exceptions.
TrackBack
TrackBack URL for this entry: http://www.typepad.com/t/trackback/324572/2610119
Listed below are links to weblogs that reference Migrating from Axis 1.1 to Axis 1.2:
Tracked on December 1, 2005 02:58 PM:
» The Blogosphere from Blog 57
1
Many weblogs are densely interconnected [Read More]

Comments
Posted by SF User on July 28, 2005 11:42 AM:
Migration for axis 1.2 to 1.1
I tried to create the proxies using 1.2 .. It doesnt create the session Header.. And there are lot more files that are not getting created... ???
Ofcourse , If I could get it to work . then I guess the bug fixes and other features are great to live with..!!
Posted by Simon Fell on July 28, 2005 11:49 AM:
You still need to use the -a switch in WSDL2Java to get the SessionHeader and other additional classes generated.
Posted by SF User on July 28, 2005 03:14 PM:
Yup.. Its working now.. This is just awesome..!
Thanks..
Posted by Mamatha Gadipudi on September 7, 2005 10:55 AM:
Hi,
I regenerated all my class files from my WSDL using axis 1.2. But I am not able to query some objects.
like this:
Error in Internal Follow Up org.xml.sax.SAXException: Invalid element in com.sforce.soap.enterprise.sobject._case - Mode__c
can any one help me with this problem...
Thanks in advance,
Mamatha
Posted by Pierre Eymard on September 29, 2005 03:44 PM:
Using Axis1.2, JDK1.5, compiling generated classes with WSDL2Java plugin for eclipse gives: ..src\com\sforce\soap\enterprise\FieldType.java :59: as of release 1.5, 'enum' is a keyword, and may not be used as an identifier (try -source 1.4 or lower to use 'enum' as an identifier). Is there a way to configure the wsdl generator or an easy way to solve that ?
Posted by Simon Fell on September 29, 2005 11:18 PM:
have you tried using Axis 1.2.1 ?
Posted by Pierre Eymard on October 3, 2005 11:41 AM:
yes, it's the version used.
Posted by Simon Fell on October 3, 2005 09:10 PM:
you need to regenerate the client side code using the WDSL2Java tool from 1.2.1, you can't take a client stub generated from Axis 1.1 and run it with Axis 1.2.
Posted by Subir S on October 20, 2005 06:47 AM:
***Axis no longer generates a wrapper class for simple type restrictions, this means that the ID class disappears, ID is now treated as a plain jane String.***
-Is this a bug? Any work arounds for this??
-In my wsdd file i have some thing like this.
***typeMapping
xmlns:myNS="urn:ScheduleServices"
qname="myNS:ScheduleValidationStatusEnum"
languageSpecificType="java:dummy.ScheduleValidationStatusEnum
serializer="org.apache.axis.encoding.ser.EnumSerializerFactory"
deserializer ="org.apache.axis.encoding.ser.EnumDeserializerFactory"
encodingStyle="http://www.w3.org/2001/XMLSchema"
***
PS:*** to be replaced by open and close angle brackets.
-I am generating the stubs for this using WSDL2Java in Axis 1.2.
-It does not generate the Enum classes for my user defined type.
-It also replaces the beans variables with this user_defined type with java.lang.String type after generation.
Any solution to this problem is greatly appreciated.
Posted by Subir S on November 15, 2005 09:05 AM:
The encoding Style of the Type mapping is not correct.
It should be http://schemas.xmlsoap.org/soap/encoding/
The enums can be generated using Axis 1.2 by keeping dotNetSoapEncFix global attribute in Server-Config.wsdd to true. Refer to http://issues.apache.org/jira/browse/AXIS-1879 for details.
Posted by Brinda on February 7, 2008 02:57 AM:
How can add the security header information in axis1.1 request?
I am able to make the request in axis1.2 and not in axis 1.1
Example:
http://xxxx.com:8999/mockey/service/xxxxx
icehttp://www.w3.org/2005/08/addressing/anonymousurn:uuid:7F92E349CAE3CAAF6B12022866418771
Posted by Veronica on February 7, 2008 01:42 PM:
Hi,
We are migrating our application from axis 1.1 to 1.4 (this is a must since we're also migrating from java 1.4 to 1.5) and I'm receiving this error:
Deserializing parameter 'xxx': could not find deserializer for type {yyy}empty
Do you have any idea why I get this error?
Thank you