Lye - a COM to SOAP gateway...
Andrew Dalke
dalke at acm.org
Wed Sep 13 21:47:21 EDT 2000
Alex Martelli wrote:
>"Andrew Dalke" <dalke at acm.org> wrote in message
>news:8pnaou$gc2$1 at slb6.atl.mindspring.net...
>> [..and a request for COM help]
> [snip]
>> I've written a program called Lye which is a simple COM server
>> that forwards calls to a SOAP server using /F's soaplib. It's
>
>Excellent idea!
Thanks! And of course, Python and its various libraries make it
extremely simple. There's no way I could have gone from zero (no
COM server experience) to working gateway in a day using VB or C++.
>You have a Visual Basic problem. [...]
>You need to do a *SET* assignment, which must always be explicit:
Cool! That fixed it. You know, I used to be a huge Basic coder,
but only up to QuickBasic in '92. :)
>A LET-assignment to/from an object uses/changes the *DEFAULT
>VALUE* property of that object; it takes a SET-assignment to use
>or change *THE OBJECT ITSELF*.
Okay, and now I understand why I was getting a request for _value_.
>> what to return, or if I should raise an exception.
>
>I think that simply not having _value_ should give the
>right kind of error ("no such property or method"; an
>object *IS* allowed not to have a default property, if
>it does not make sense for it).
I'll fix the code to raise that error if _value_ is requested.
[regarding names]
>You can take various tacks, but a read-only indexed property
>is what I've found smoothest, rather than a factory-method.
>
>In VB, that would look like:
> set soap = factory.Soap("whatever")
I think you are right. That does appear more natural. Plus,
during development I was having problems remembering if it was
"make" or "create", and having no name is easier to remember.
>If you want to keep it as a method for some reason, I think
>MakeSoap, CreateSoap, and GetSoap are good candidates.
>Usual convention is to have MixedCase (the first letter also
>uppercased).
Actually, I'm thinking of using the factory object as a simple
service locater, so 'factory.Service("xmethods-Temperature")'
returns, say, the SOAP interface to the weather lookup service
mentioned at http://www.xmethods.com/ . If I knew what it was
talking about. :)
Thanks again for your help,
Andrew Dalke
dalke at acm.org
More information about the Python-list
mailing list