function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
firefoxfirefox 

problem with sObject.get_any()

Hi all, I am upgrading existing Axis code to Axis2. It's become even worse since the underlying Object model has also been changed.  

 

 -> Axis:

         - sObject.get_any() returns MessageElement.

-> Axis2:

          - I am facing trouble in finding relevant corresponding one. Is it the following?

             sObject.getExtraElement() ?

 

Let me know if someone has already faced similar problems. Please help.

Best Answer chosen by Admin (Salesforce Developers) 
firefoxfirefox

 

When you use - Axis2, partner.wsdl, here is how one should retrieve values of various fields in a SObject (we do not have Account, Contact, etc objects in partner.wsdl)

 

-- OMElement[] records = queryResponse.getResult().getRecords()[0].getExtraElement();

 

for(OMElement record : record){

String name = record.getLocalName();

String value = record.getText();

}

All Answers

dkadordkador

Our suggestion is usually to remain on Axis 1.  Do you have a hard requirement to use Axis 2?

firefoxfirefox
Thanks for the reply dkador. 

- The existing implementation was 5-6 years old. In addition, it seems axis2 has better performance compared to axis.

I am just wondering about your reply -  "Our suggestion is usually to remain on Axis 1"

- May I know the reason? Is it something like upgrading has no benefits at all with sforce api? I may raise the issue if so. 

It's obvious if Axis2 is at initial stage but I guess it's pretty stable now and intensive work going on.
SuperfellSuperfell

We've yet to see a case where the additional complexity from switching to Axis2 was worth the effort. You might want to look at WSC (and you might also want to strongly consider doing nothing, unless you're having siginificant perf issues with Axis1)

firefoxfirefox

Thank you SimonF. 

 

Now, I understand that there is no point in upgrading as of now. I will raise the issue. 

 

However, it seems my part is not very cumbersome and needs only a few relevant concepts of Axis2 version. 

 

If possible, can you please clarify

 

1)  the actual question [1st post]

 

2) queryMore() concept has a lot of new entries in Axis2.  (QueryMore object, etc.) So, any sample code?

 

 The reason is that I can't stop upgrading task immediately, and meanwhile I should have some progress.

 

So I apologize beforehand, please help if you have any idea.

firefoxfirefox

 

When you use - Axis2, partner.wsdl, here is how one should retrieve values of various fields in a SObject (we do not have Account, Contact, etc objects in partner.wsdl)

 

-- OMElement[] records = queryResponse.getResult().getRecords()[0].getExtraElement();

 

for(OMElement record : record){

String name = record.getLocalName();

String value = record.getText();

}

This was selected as the best answer
ryan@ekeche.comryan@ekeche.com

To add to the responses posted by others in this thread and basically to help out our many friends in IT who are likely to stumble across this answer, I want to share some observations from personal experience:

 

  1. It's very easy to use the partner WSDL from SFDC with Axis (e.g. Axis 1.4), but it's very difficult to use the partner WSDL with Axis2 (e.g. Axis2 1.5.1 or 1.6.0). This is in part due to the very verbose code required to do anything with Axis2, though using the enterprise WSDL isn't too cumbersome.
  2. Based on my research, to use the partner WSDL with Axis2, it seems to me that you would basically need to create facsimiles of the "SObject" objects that are created from the enterprise WSDL. If you decide to use this approach, generate the stubs from the enterprise WSDL as well and use the code generated for "Account", "Contact", etc, as a starting point to create your custom "SObject" objects. Note that those objects are not simple/straightforward.
  3. That said, my recommendation, simply, is to use the enterprise WSDL if you want to use Axis2. If you feel compelled to use the partner WSDL with some version of Axis, use it with the previous version of Axis.