Jeff,

    Thanks for the detailed reply and sorry for not getting back to you earlier.  When looking at the Import class that you described, it seems like it only imports schemaLocation attributes.  I'm specifically looking for it to import a wsdl file.  The differences are,

<import namespace="some:namespace" location="the-wsdl-file.wsdl" />
and
<import namespace="some:namespace" schemaLocation="the-wsdl-file.wsdl" />

I believe suds handles the second instance properly, but does nothing about the first.  Am I wrong? 


Thanks,
Nathan

On Wed, Jun 11, 2008 at 9:52 AM, Jeff Ortel <jortel@redhat.com> wrote:
Hey Nathan,

What version of suds are you using?

Actually, a lot of effort has been put into suds to properly handle schema imports.  If fact, my 0.2.2 development workspace has yet another iteration which handles imports slightly differently then 0.2.1 and earlier.  Anyway, in 0.2.1 and trunk, the import elements are resolved by reading (importing) the referenced schema using the URI specified in the location attribute of the <import location=""/> element.  If the location attribute is not specified, suds attempts to read (import) the schema using the URI of the namespace attribute (if specified).  Once read, the imported schema is parsed and its content substituted for the <import/> element in the importing schema.  If you look at the schema.Import class, you'll see where this happens.

In 0.2.2, this basically happens the same way except the <Import/> element isn't replaced.  Instead, after importing the referenced schema, the Import class in the object model brokers find() requests made by the enclosing schema so that referenced types in the imported schema can be found.  The main reason for this change has to do with handling situations where 2 (or more) schemas import each other (yes this happens) which causes  0.2.1 (and earlier) to get into  a infinite recursion problem :-(.

Anyway, the 0.2.1 (and earlier) version of the Imprort class fail silently (except debug logging) when the schema can't be imported. This might be why it looks to you like the <import/> isn't doing anything or that this functionality is missing.

I suggest you try one of more of the following:

* try browsing to the URL specified in the location attribute of the <import/> and verify that it is correct
* turn on debug level logging
* add some print statements
* set a break point in the Import class

and determine why the imported schema is not being imported.

Also, I'll be committing the 0.2.2 release candidate code into svn sometime this week (I hope) which will raise an exception when <import location=""/> has the location attribute and can't be resolved.

Please let me know how you make out.

Regards,

Jeff



Nathan Van Gheem wrote:
Hello,

   I am curious as to how import statements are supposed to work in wsdl files.  As of right now it doesn't seem like it does anything special for it.  It just treats it as a regular element.  Shouldn't it grab the import and parse it?  A typical import statement is like so,

   <import namespace="some:namespace" location="the-wsdl-file.wsdl" />


I have begun to attempt to add support for this, but am coming across namespace issues I think.  This also applies to import xsd files; although those are a little different.

I am new to all of this so I might be off, but I guess I'm just wondering what your thoughts are.  I am attempting to implement WSRP with suds and this functionality is needed.  Thanks for any feedback.


-Nathan Van Gheem


------------------------------------------------------------------------

_______________________________________________
fedora-suds-list mailing list
fedora-suds-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-suds-list