[ http://jira.codehaus.org/browse/XFIRE-609?page=comments#action_81025 ] 
            
Alan Baldwin commented on XFIRE-609:
------------------------------------

I'm having the exact same problem.  I have the same setup as Robert with nested 
schemas and XMLBeans, however, with one exception...  I am using xs:import 
instead of xs:include.  I *DO* have a targetNamespace in the nested document, 
but it is different than that of the parent document, and therein lies the rub. 
 If I use the xs:include statement, I can leave out the targetNamespace 
attribute, and everything is fine.  In the latter case I use the same namespace 
for both documents.

The reason I had tried to use xs:import instead of xs:include in the first 
place was that I was trying to get rid of the schemaLocation attribute from the 
generated WSDL... It hoses .NET client bindings.  For this problem, I will ask 
the user list.  My workaround is to flatten the schemas, but that's very ugly 
as far as schema reuse goes.

> Missing targetNamespace in source schema causes NullPointerException in 
> XmlBeansWSDLBuilder
> -------------------------------------------------------------------------------------------
>
>                 Key: XFIRE-609
>                 URL: http://jira.codehaus.org/browse/XFIRE-609
>             Project: XFire
>          Issue Type: Bug
>          Components: XMLBeans
>    Affects Versions: 1.1.2
>            Reporter: Robert Watkins
>         Assigned To: Dan Diephouse
>             Fix For: 1.2.4
>
>         Attachments: xfire-bug.zip
>
>
> I had a schema file that imported several other schema files. The top-level 
> one specified a targetNamespace for the schema, but the imported ones did not.
> The schemas were proccessed by XmlBeans without any problems.
> When using the XmlBean-generated classes in XFire, I got a 
> (very-hard-to-diagnose) NullPointerException in the XmlBeansWSDLBuilder, at 
> line 46. The NPE was caused by the fact that getSchema() returns null at line 
> 82, if the XPath expresssion //xsd:[EMAIL PROTECTED]'" + ns + "']" fails to 
> find anything.
> Ideally, the code would use the importing schema's targetNamespace (well, at 
> least that's what XmlBeans does). At the very least, however, throwing an 
> exception indicating which schema was being processed and didn't have the 
> targetNamespace would make the error easier to diagnose and to fix.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to