Monday, April 02, 2007

One last hitch

According to this, friendly errors such as

/opt/local/lib/ruby/gems/1.8/gems/soap4r- `class_schema_variable': undefined method `class_variables' for nil:NilClass (NoMethodError)
from /opt/local/lib/ruby/gems/1.8/gems/soap4r- `schema_ns_definition'
from /opt/local/lib/ruby/gems/1.8/gems/soap4r- `schema_definition_classdef'
from /opt/local/lib/ruby/gems/1.8/gems/soap4r- `schema_definition_from_class'
from /opt/local/lib/ruby/gems/1.8/gems/soap4r- `any2soap'
from /opt/local/lib/ruby/gems/1.8/gems/soap4r- `obj2soap'
from /opt/local/lib/ruby/gems/1.8/gems/soap4r- `stubobj2soap'
from /opt/local/lib/ruby/gems/1.8/gems/soap4r- `each'
from /opt/local/lib/ruby/gems/1.8/gems/soap4r- `stubobj2soap'
... 15 levels...
from /opt/local/lib/ruby/gems/1.8/gems/soap4r- `call'
from /opt/local/lib/ruby/gems/1.8/gems/soap4r- `call'
from (eval):6:in `search'

prohibit the following default generated objects from correctly mapping when invoking the NetSuite searches:

  • OpportunitySearchBasic

  • EmployeeSearchBasic

  • PartnerSearchBasic

  • ItemSearchBasic

  • TimeBillSearchBasic

Each of which contain an entity named 'class', and while soap4r intelligently generates an attribute 'v_class', it also erroneously generates accessor methods that override Object.class. Big woops. Extremely easy fix just by renaming those methods.


mister stache! said...

Incidentally, how did you invoke these searches? I've been trying with the latest copy of soap4r, and it's not catching the subclass of the abstract SearchRecord class when it comes time to obj2soap() any of the *SearchBasic classes.

RR said...

Perhaps this sample code for CustomerSearchBasic with soap4r ( will be helpful:

entity ="Vandalay Industries")
entity.xmlattr_operator = SearchStringFieldOperator::Contains

search =
search.entityId = entity
customer =

mister stache! said...

Odd - I've been using soap4r trunk, and when I send what you have there, I get the same result as what's described here: