tags:

views:

25

answers:

1

Type not found: '(ArrayOfint, http://schemas.microsoft.com/2003/10/Serialization/Arrays, )' is what suds resolver raises. In ...2003/10/Serialization/Arrays ArrayOfInt is defined, so I guess linux' case sensitivity is the problem. Any Idea how I can get around that?

from suds.client import Client
c = Client("https://developer-api.affili.net/V2.0/Logon.svc?wsdl")

used to return

Type not found: '(ArrayOfint, http://schemas.microsoft.com/2003/10/Serialization/Arrays, )'

now since a few days I don't even get there anymore but instead I get a

TypeNotFound: Type not found: '(Logon, http://affilinet.framework.webservices/types, )'
A: 

Sounds like you have a broken WSDL. This is where you'll need to use the ImportDoctor provided by SUDS. You need use this to help the Client constructor use the ArrayOfint type found at http://schemas.microsoft.com/2003/10/Serialization/Arrays.

I have done this in the past with other services but without seeing your WSDL or your code, this is only my best guess as to how you may fix it because I can't test it myself:

from suds.client import Client
from suds.xsd.doctor import Import, ImportDoctor

# Obviously I made this up    
wsdl_url = 'http://whatever/path/to/wsdl'

# Fix missing types with ImportDoctor
schema_url = 'http://schemas.microsoft.com/2003/10/Serialization/Arrays'
schema_import = Import(schema_url)
schema_doctor = ImportDoctor(schema_import)

# Pass doctor to Client
client = Client(url=wsdl_url, doctor=schema_doctor)

One thing worth noting is that the URL http://schemas.microsoft.com/2003/10/Serialization/Arrays is not even valid (it returns a 404), so I am really not sure that is the right URL. Although I am confident that I am at least steering you in the right direction.

Edit in response to your recent comment (2010-10-05):

Using the URL you provided of https://developer-api.affili.net/V2.0/Logon.svc?wsdl I was able to successfully create a client. I had to use an ImportDoctor because it raised the following error:

TypeNotFound: Type not found: '(Logon, http://affilinet.framework.webservices/types, )'

So I used the following code and was able to get a successful client object:

from suds.client import Client
from suds.xsd.doctor import Import, ImportDoctor

wsdl_url = 'https://developer-api.affili.net/V2.0/Logon.svc?wsdl'

schema_url = 'http://affilinet.framework.webservices/types'
schema_import = Import(schema_url)
schema_doctor = ImportDoctor(schema_import)

client = Client(url=wsdl_url, doctor=schema_doctor)

Printing the client object displays this:

Suds ( https://fedorahosted.org/suds/ ) version: 0.3.9 GA build: R659-20100219

Service ( Authentication ) tns="http://affilinet.framework.webservices/Svc"
   Prefixes (5)
      ns0 = "http://affilinet.framework.webservices/types"
      ns1 = "http://schemas.datacontract.org/2004/07/Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF"
      ns2 = "http://schemas.microsoft.com/2003/10/Serialization/"
      ns3 = "http://schemas.microsoft.com/2003/10/Serialization/Arrays"
      ns4 = "http://www.microsoft.com/practices/EnterpriseLibrary/2007/01/wcf/validation"
   Ports (1):
      (DefaultEndpointLogon)
         Methods (2):
            GetIdentifierExpiration(xs:string CredentialToken, )
            Logon(xs:string Username, xs:string Password, ns0:WebServiceTypes WebServiceType, ns0:TokenDeveloperDetails DeveloperSettings, ns0:TokenApplicationDetails ApplicationSettings, )
         Types (12):
            ns3:ArrayOfKeyValueOfstringstring
            ns1:ArrayOfValidationDetail
            ns0:Logon
            ns0:TokenApplicationDetails
            ns0:TokenDeveloperDetails
            ns1:ValidationDetail
            ns4:ValidationFault
            ns0:WebServiceTypes
            ns0:affilinetWebserviceFault
            ns2:char
            ns2:duration
            ns2:guid

Before you can use client.service.Logon() you're going to have to satisfy the type signature required by that method. You'll have to create various type objects using client.factory.create() (e.g. client.factory.create('ns0:WebServiceTypes')) and pass those objects along with your username/password.

jathanism
wsdl_url = "https://developer-api.affili.net/V2.0/Logon.svc?wsdl"I get:ERROR: An unexpected error occurred while tokenizing inputThe following traceback may be corrupted or invalidThe error message is: ('EOF in multi-line statement', (9, 0))ERROR: An unexpected error occurred while tokenizing inputThe following traceback may be corrupted or invalidThe error message is: ('EOF in multi-line statement', (119, 0))ERROR: An unexpected error occurred while tokenizing inputThe following traceback may be corrupted or invalidThe error message is: ('EOF in multi-line statement', (141, 0))
dirkbo