I agree with you.
Could you please raise a JIRA for that ?

On 11/28/06, KBerthelot <[EMAIL PROTECTED]> wrote:

I've located the bug in WsdlFlattener in the following section of code
(starting at line 184):

// Get all needed direct schemas
Set namespaces = new HashSet();
for (Iterator itMsg = flat.getMessages().values().iterator();
itMsg.hasNext();) {
    Message msg = (Message) itMsg.next();
    for (Iterator itPart = msg.getParts().values().iterator();
itPart.hasNext();) {
        Part part = (Part) itPart.next();
        QName elemName = part.getElementName();
        if (elemName != null) {
            namespaces.add(elemName.getNamespaceURI());
            Schema schema = schemas.getSchema(elemName.getNamespaceURI());
            if (schema.getImports() != null) {
                for (Iterator iter = schema.getImports().iterator();
iter.hasNext();) {
                    String ns = (String) iter.next();
                    namespaces.add(ns);
                }
            }
        }
    }
}


Notice that for each message part, the code only adds the namespace for the
part element name and does not account for the fact that the element may be
a complex type that includes elements from additional namespaces.  As a
result, only the schemas for the part element namespaces are included in the
flattened version.

It looks to me like the easy solution is to just include all the shemas
defined in the original wsdl instead of trying to include only the schemas
that are actually required by the service.  Since the code for
Jsr181Endpoint already only allows for one service per wsdl, and one port
for that service, I would think it would be unlikely that you'd end up with
a lot of unused schemas.  Even if you did, it shouldn't cause any problems.

Otherwise you'd have to recursively go through the element definitions to
find all the namespaces.



Christian Schneider-16 wrote:
>
> To my experience xfire generated schemas always include all types so
> there should be no import when we generate the schema from xfire.
> But you are of course right if the wsdl is specified in the endpoint
> definition. In this case WSDLFlatten has to be called. Perhaps the code
> can be strutctured in this way.
> In any case we should look into the problem why WSDLFlatten does not
> include the types from other namespaces.
>
> I will try to create a unit test for this specific problem. So we can
> test a later implementation. Would this help you?
>
> Best regards,
>
> Christian
>
> Guillaume Nodet schrieb:
>> The WSDLFlattern has to be called so that imported schema
>> become inlined. See http://issues.apache.org/activemq/browse/SM-727.
>> So your fix would not work :(
>>
>> On 11/10/06, Christian Schneider <[EMAIL PROTECTED]> wrote:
>>> Hi Guillaume,
>>>
>>> I have looked into the code and I think you can simply configure xfire
>>> to not create a binding. So perhaps you can then use the xfire generated
>>> wsdl.
>>>
>
> --
>
> Christian Schneider
> ---
> http://www.liquid-reality.de
>
>
>

--
View this message in context: 
http://www.nabble.com/Incorrect-wsdl-for-jsr181-component-tf2585069s12049.html#a7583276
Sent from the ServiceMix - User mailing list archive at Nabble.com.




--
Cheers,
Guillaume Nodet

Reply via email to