2009-08-25 13 views
10

मैं निम्नलिखित सरल अजगर परीक्षण स्क्रिप्ट Suds का उपयोग करता है एक सोप वेब सेवा (सेवा ASP.net में लिखा है) कॉल करने के लिए:अजगर/बीर: प्रकार नहीं मिला: 'XS: complexType'

from suds.client import Client 

url = 'http://someURL.asmx?WSDL' 

client = Client(url) 

result = client.service.GetPackageDetails("MyPackage" ) 

print result 

जब मैं इस परीक्षण स्क्रिप्ट मैं निम्न त्रुटि हो रही है चलाने (प्रयुक्त कोड मार्कअप लपेट के रूप में नहीं है):

No handlers could be found for logger "suds.bindings.unmarshaller" 
Traceback (most recent call last): 
    File "sudsTest.py", line 9, in <module> 
    result = client.service.GetPackageDetails("t3db" ) 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/client.py", line 240, in __call__ 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/client.py", line 379, in call 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/client.py", line 240, in __call__ 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/client.py", line 422, in call 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/client.py", line 480, in invoke 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/client.py", line 505, in send 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/client.py", line 537, in succeeded 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/binding.py", line 149, in get_reply 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py", line 303, in process 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py", line 88, in process 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py", line 104, in append 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py", line 181, in append_children 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py", line 104, in append 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py", line 181, in append_children 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py", line 104, in append 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py", line 181, in append_children 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py", line 102, in append 
    File "build/bdist.cygwin-1.5.25-i686/egg/suds/bindings/unmarshaller.py", line 324, in start 
suds.TypeNotFound: Type not found: 'xs:complexType' 

WSDL फ़ाइल के हेडर के लिए स्रोत को देखते हुए (फिट करने के लिए पुन: स्वरूपित):

<?xml version="1.0" encoding="utf-8" ?> 
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:s="http://www.w3.org/2001/XMLSchema" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:tns="http://http://someInternalURL/webservices.asmx" 
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
targetNamespace="http://someURL.asmx" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> 

मैं उत्पादन की अंतिम पंक्ति के आधार पर अनुमान लगा हूँ:

suds.TypeNotFound: Type not found: 'xs:complexType' 

मैं सूद के doctor class उपयोग करने की आवश्यकता है कि स्कीमा ठीक करने के लिए किया जा रहा है लेकिन एक सोप नौसिखिया मैं वास्तव में क्या जरूरत है मेरे मामले में तय हो गई पता नहीं है। क्या किसी को स्कीमा को ठीक करने/सही करने के लिए सूड का उपयोग करके कोई अनुभव है?

+1

मैंने अभी एक सरल सी # परीक्षण आवेदन करने की कोशिश की है और यह इस सेवा से जुड़ा जुड़ा हो सकता है (लेकिन फिर सेवा एएसपीनेट आधारित है)। क्या यह माइक्रोसॉफ्ट विशिष्ट कुछ हो सकता है कि सूड डिफ़ॉल्ट रूप से समर्थन नहीं करता है? – Danielb

+0

ऐसा लगता है कि सेवा डेटासेट को वापस करने का प्रयास कर रही है। मैं लॉगर में निम्नलिखित देख रहा हूं: चेतावनी: suds.bindings.unmarshaller: विशेषता (IsDataSet) प्रकार, नहीं मिला चेतावनी: suds.bindings.unmarshaller: विशेषता (नाम) प्रकार, नहीं मिला त्रुटि: सूड .bindings.unmarshaller: स्कीमा: 0x7fce048c – Danielb

+0

मुझे लगता है जैसे एसयूडीएस टैग से आयात नहीं कर रहा है जो डेटा सेट की संरचना निर्दिष्ट करता है। क्या आपने आयात के लिए अपने डब्लूएसडीएल की खोज की है? यदि यह उत्तर है, तो SUDS 'ImportDoctor मदद करने में सक्षम होना चाहिए। Https://fedorahosted.org/suds/wiki/Documentation#FIXINGBROKENSCHEMAs – ewall

उत्तर

15

ईवल का संसाधन एक अच्छा है। यदि आप सूड ट्रैक टिकटों में खोज करने का प्रयास करते हैं, तो आप देख सकते हैं कि अन्य लोगों को similar to yours समस्याएं हैं, लेकिन विभिन्न ऑब्जेक्ट प्रकारों के साथ। यह इसके उदाहरणों से सीखने और उनके नामस्थानों को आयात करने का एक अच्छा तरीका हो सकता है।

The problem is that your wsdl contains a schema definition that references the (...) but fails to import the " http://schemas.xmlsoap.org/soap/encoding/ " namespace (and associated schema) properly. The schema can be patched at runtime using the schema ImportDoctor as discussed here: https://fedorahosted.org/suds/wiki/Documentation#FIXINGBROKENSCHEMAs .

This is a fairly common problem.

A commonly referenced schema (that is not imported) is the SOAP section 5 encoding schema. This can now be fixed as follows:

(सभी जोर मेरा थे)।

आप उन लाइनों को आजमा सकते हैं जो ये दस्तावेज आपके डब्लूएसडीएल में प्रस्तुत नामस्थान जोड़ते हैं। यह एक कोशिश-और-त्रुटि अपमान हो सकता है।

imp = Import('http://schemas.xmlsoap.org/soap/encoding/') 
# Below is your targetNamespace presented in WSDL. Remember 
# that you can add more namespaces by appending more imp.filter.add 
imp.filter.add('http://someURL.asmx') 
doctor = ImportDoctor(imp) 
client = Client(url, doctor=doctor) 

आप डबल्यूएसडीएल आप के साथ काम कर रहे हैं प्रदान नहीं किया, मुझे लगता है आप हमें दिखाई नहीं दे करने के लिए कारणों से है ... तो मुझे लगता है कि आप अपने आप से इन संभावनाओं की कोशिश करने के लिए है। सौभाग्य!

+0

पर उदाहरण मैं इसे किसी कारण से उत्तर के रूप में स्वीकार नहीं कर सकता :( – Danielb

+0

मुझे पता है कि यह आपकी समस्या को पूरी तरह से हल नहीं करता है ... लेकिन तब से आप अपना wsdl प्रदान नहीं कर सकते हैं, मैं इस स्थिति में बिल्कुल सही समस्या का पता लगाने की कोशिश नहीं कर सकता, इसलिए मैंने कुछ सामान्य "अंधेरे डीबगिंग सलाह" के साथ आपकी मदद करने की कोशिश की ताकि आप यह देख सकें कि क्या आप समस्या से खुद को आगे बढ़ा सकते हैं। लेकिन चूंकि आपने यह टिप्पणी लिखी है, मुझे लगता है कि आपको अपनी समस्या का कोई समाधान नहीं मिला ... क्या आपने आधिकारिक सूड का समर्थन करने की कोशिश की? – GmonC

संबंधित मुद्दे