Comments (5)
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.
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.
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.
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.
no activity for a looong time, closing. reopen if you're back on the subject.
from spyne.
Related Issues (20)
- spyne.model.complex.XmlAttribute issue HOT 1
- ComplexModels attempting to use in-line customization are silently dropped from inheriting objects HOT 2
- Add Starlette as server transport option HOT 2
- Modernise to use type annotations rather than @rpc(Unicode, Integer, _returns=Iterable(Unicode)) HOT 2
- only old docs available HOT 1
- How to use the type AnyXml correctly? HOT 1
- Strategies for dealing with broken clients? (invalid documents) HOT 3
- Python3 - TypeError: sequence item 0: expected a bytes-like object, int found
- spyne.server.django.DjangoView.as_view small bug HOT 1
- Flask Example Werkzeug DispatcherMiddleware import does not work
- GHSL-2021-115 HOT 3
- SQLAlchemy 1.4 support HOT 2
- etreeconv: Python 3.10 incompatible "collections.Sized"
- Exposing simple types on WSDL with Spyne
- Unable to use ByteArray value received HOT 3
- Re-opening issue on ByteArray HOT 1
- I could not read data from wsdl file
- How to get access soap request body elements
- Returning response is not xml format, it is json HOT 4
- Aarry not add xml tag HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spyne.