Wrap function parameters complexType in an element

qvdb

I am trying to implement an existing webservice with Spyne. I have a function that takes two parameters, for which the WSDL should look like this:

<wsdl:types>
  <xs:schema targetNamespace="http://example.com/" elementFormDefault="qualified" >
    <s:element name="getData">
      <s:complexType>
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="login" type="s:string"/>
          <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
        </s:sequence>
      </s:complexType>
    </s:element>
[...]

My code contains the following decorator for this function:

@rpc(String(min_occurs=0, max_occurs=1, nillable=False),
     String(min_occurs=0, max_occurs=1, nillable=False),
     _returns=Unicode)
def getData(self, login, password):
     return 'data'

Which produces this WSDL:

<wsdl:types>
    <xs:schema elementFormDefault="qualified" targetNamespace="http://example.com/">
        <xs:complexType name="getData">
            <xs:sequence>
                <xs:element minOccurs="0" name="login" type="xs:string" />
                <xs:element minOccurs="0" name="password" type="xs:string" />
            </xs:sequence>
        </xs:complexType>
[...]

So instead of an element containing a complexType I just have a bare complexType. This difference causes issues with clients that are compatible with the existing implementation. Is there a way to wrap the complexType in an element using Spyne?

Burak Arslan

Spyne's wsdl should contain both:

<xs:complexType name="getData"> (...) </xs:complexType>

and

<s:element name="getData" type="tns:getData">

Having complexType inside element is equivalent to having it outside with proper referral like this, so your parser should be able to cope with both forms.

If you don't have any control over the client, as that's often the case in such situations, you have no option but to patch Spyne. If you want to go that route, please join spyne ml (http://lists.spyne.io/listinfo/people) so we can talk.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Unique constraint on a complexType instead of an element

From Dev

XSD : ComplexType Element With the Same Name

From Dev

Using Jquery wrap function with absolute placed element

From Dev

How to utilize complexType without wrapper element in XSD?

From Dev

named the s:element and s:complexType the same name

From Dev

How to utilize complexType without wrapper element in XSD?

From Dev

named the s:element and s:complexType the same name

From Dev

XML Schema: complexType element not supported in this context

From Dev

Breezejs ComplexType not executing a custom initializer function

From Dev

I am trying to wrap a return value from a function with an html element

From Dev

Duplicating an html element that passes id parameters in a function

From Dev

Automatically wrap parameters in Options

From Dev

How to wrap a generic powershell function with set parameters into a new more specified function?

From Dev

How to declare a complexType has only one child element?

From Dev

Can I give the same name to complexType and element - XSD Standards

From Dev

How to declare a complexType has only one child element?

From Dev

Can I give the same name to complexType and element - XSD Standards

From Dev

XML schema - element within complexType causing error message

From Dev

Wrap the function into another function

From Dev

What are the link: Function "parameters" (scope, element, attrs)? AngularJS

From Dev

How to use more parameters in an element.someEvent function

From Dev

Send setTimeout name, element id, and time as parameters of a function?

From Dev

How to use more parameters in an element.someEvent function

From Dev

How to wrap the jQuery function

From Dev

Wrap/overwrite function in Bash

From Dev

Wrap delegate in std::function?

From Dev

Wrap a function as an async task

From Dev

wrap couchbase access function

From Dev

wrap overloading function with generics

Related Related

  1. 1

    Unique constraint on a complexType instead of an element

  2. 2

    XSD : ComplexType Element With the Same Name

  3. 3

    Using Jquery wrap function with absolute placed element

  4. 4

    How to utilize complexType without wrapper element in XSD?

  5. 5

    named the s:element and s:complexType the same name

  6. 6

    How to utilize complexType without wrapper element in XSD?

  7. 7

    named the s:element and s:complexType the same name

  8. 8

    XML Schema: complexType element not supported in this context

  9. 9

    Breezejs ComplexType not executing a custom initializer function

  10. 10

    I am trying to wrap a return value from a function with an html element

  11. 11

    Duplicating an html element that passes id parameters in a function

  12. 12

    Automatically wrap parameters in Options

  13. 13

    How to wrap a generic powershell function with set parameters into a new more specified function?

  14. 14

    How to declare a complexType has only one child element?

  15. 15

    Can I give the same name to complexType and element - XSD Standards

  16. 16

    How to declare a complexType has only one child element?

  17. 17

    Can I give the same name to complexType and element - XSD Standards

  18. 18

    XML schema - element within complexType causing error message

  19. 19

    Wrap the function into another function

  20. 20

    What are the link: Function "parameters" (scope, element, attrs)? AngularJS

  21. 21

    How to use more parameters in an element.someEvent function

  22. 22

    Send setTimeout name, element id, and time as parameters of a function?

  23. 23

    How to use more parameters in an element.someEvent function

  24. 24

    How to wrap the jQuery function

  25. 25

    Wrap/overwrite function in Bash

  26. 26

    Wrap delegate in std::function?

  27. 27

    Wrap a function as an async task

  28. 28

    wrap couchbase access function

  29. 29

    wrap overloading function with generics

HotTag

Archive