Giter Site home page Giter Site logo

possible enhancement for anyType about spyne HOT 5 CLOSED

arskom avatar arskom commented on May 6, 2024
possible enhancement for anyType

from spyne.

Comments (5)

plq avatar plq commented on May 6, 2024

i have mixed feelings about this. i think you should be using proper object definitions if you need such a functionality.

any is just a more efficient way to communicate valid xml through soap, nothing more.

from spyne.

ba-serge avatar ba-serge commented on May 6, 2024

In no way I propose to delete the default Any class. I'd rather propose to add something like AnyAsKnownType.

The problem is that the document/literal wrapped wsdl type does not support overloading, so that if you have a method working with several types you can use either XML Schema inheritance from abstract base or any type. Now, as fas as I know soaplib does not support abstract attribute, so you are left only with anyType.

Besides, here is a citation from wsdl specs:
"Use the xsd:anyType type to represent a field/parameter which can have any type. "

from spyne.

plq avatar plq commented on May 6, 2024

In no way I propose to delete the default Any class.

i didn't say you were.

The problem is that the document/literal wrapped wsdl type does not support overloading, so that if you have a method working with several types you can use either XML Schema inheritance from abstract base or any type. Now, as fas as I know soaplib does not support abstract attribute, so you are left only with anyType.

huh. python doesn't (officially) support method overloading. how will you define the service with soaplib?

it shouldn't be that hard to add abstract bases to soaplib. why not work on the proper solution instead of hacks and workarounds?

"Use the xsd:anyType type to represent a field/parameter which can have any type. "

that's right. so if you know the type in advance, you shouldn't be using it.

those said, did you look at lxml.objectify? it's like cPickle for xml.

from spyne.

ba-serge avatar ba-serge commented on May 6, 2024

Yep, Python does not support overloading either. But! Python is duck typed, so it does not
care about types at all, for me it is almost "overloading", whereas the soap layer forces types. Now, if I have several complex types in my wsdl, that are suitable for my operation why not to allow anyType for that operation? Here is a live example, I have a data bank (ZODB in fact) that stores any types I throw, my real data can be quite different. I store some geometrical data that can be either primitives or very complex finite element models.

it shouldn't be that hard to add abstract bases to soaplib. why not work on the proper >solution instead of hacks and workarounds?
I wouldn't say it is a hack. It is just a convenience thing some may find useful. But you may be right to implement abstract instead.

I have to check what lxml.objectify is

from spyne.

plq avatar plq commented on May 6, 2024

no activity for a looong time, closing. reopen if you're back on the subject.

from spyne.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.