On 06/25/2012 01:44 PM, Burak Arslan wrote:
On 06/25/12 21:19, C Anthony Risinger wrote:

I couldn't run your code, (I don't have the awesome package)


yeah if it's not obvious i changed the name, but that file is just
pure autogenerated Model definitions, so you can sub with any file
that contains request Models and corresponding METHOD+'Response'
Models, and it *should* work :-)


i know but that doesn't make my life any easier.

yes i know :-( sorry about that. sometimes difficult to timely provide enough context, but still omit the details i must.

will try a bit harder to ensure reproductions work OOTB.

but the
responsible for this is the get_method_id in ServiceBase.

https://github.com/arskom/spyne/blob/master/spyne/service.py#L200

Does replacing the 'descriptor.function.__name__' with 'descriptor.name'
solve your problem?

eureka!  yes, either changing to a set() or using descriptor.name
solves the issue, thanks!

so now i just need to crack the "self-import" problem ....

enable debug logging:

logging.getLogger('spyne.interface._base').setLevel(logging.DEBUG)

and look where the self import is coming from.

this is the line we're hunting for:
https://github.com/arskom/spyne/blob/db9085c2deb34fd44c2eb3bd00a31654db6282db/spyne/interface/_base.py#L322

ok, debug isn't working quite right for some reason, probably because i'm currently using the rpclib wrapper to test before i s,rpclib,spyne,g ... so i just print'ed it instead:

importing 'http://awesome.service.com/' to 'http://awesome.service.com/' because 'address_' extends 'address'

... now i see this is probably my issue. to give context, `address` is a Model for a legacy service, using camelCase, and `address_` is the "new" service ... virtually identical except it uses underscores and adds a `type` member:

models.py (autogenerated, edited)
----------------------------------
std = {'nillable': False,
       'max_occurs': 1,
       'min_occurs': 1}
ns = 'http://awesome.service.com/'

address = type('address',
 (ComplexModel,),
 {'__namespace__': ns,
  '_type_info': {'city': String.customize(**std),
                 'state': String.customize(**std),
                 'street': String.customize(**std),
                 'zip': String.customize(**std)}})

address_ = type('address_',
 (ComplexModel,),
 {'__extends__': address.customize(**std),
  '__namespace__': ns,
  '_type_info': {'type': String.customize(**std)}})
----------------------------------

... sorry i had to edit that for posting, but i don't think you'll need real code here; am i doing that right? and what is the proper way to expose the two services? should i just make a second Service() instance and add it like:

Application(services=[serviceCamnelCase, service_underscores])

... i'd like to share types because ~1/2 overlap.

note: my application does this hacky business to patch in JSON support:

SimpleModel.__bases__ += (XSimpleJson,)
ComplexModel.__bases__ += (XComplexJson,)
Array.__bases__ += (XIterableJson,)

... which are mixin classes that simply add a few methods (to_json/etc). i also don't use String directly, i instead use pre-generated Primitives (Strings with patterns/limits/etc). i'm almost certain neither are affecting here, though i'm mentioning just in case. i edited the excerpt to improve clarity only, nothing else.

thanks again Burak, much appreciated.

--

C Anthony



-----------------------------------------
CONFIDENTIALITY: The information contained in this communication may be 
confidential and is intended only for the use of the intended recipient(s). If 
the reader of this message is not the intended recipient(s), you are hereby 
notified that
any dissemination, distribution, or copying of this communication, or any of 
its contents, is strictly prohibited. If you have received this communication 
in error, please return it to the sender immediately and delete any copy of it 
from your computer system.
_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap

Reply via email to