You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Julien Charon <Ju...@avitech.aero> on 2015/06/15 10:50:41 UTC

schemaLocation not correclty replaced in xsd

  Hi all,


I have a webservice running on tomcat and wanted to do some basic tests using SOAP UI. The tests failed because at some point SOAP UI wasn't able to correctly handle XSDs that are referenced from the WSDL. I took a deeper look at the behaviour and realised that not all schemaLocation attributes in referenced XSDs are replaced correctly.
For example, assuming schema A is referencing schemas B and C, only reference to B is replaced correctly:
<schema>
...
<import namespace="http://www.b.org" schemaLocation="b.xsd" />
<import namespace="http://www.c.org" schemaLocation="c.xsd" />
...
</schema>

Is replaced to:

<schema>
...
<import namespace="http://www.b.org" schemaLocation="http://myserver/mySoapApp/service/soap?xsd=http://www.b.org/b.xsd" />
<import namespace="http://www.c.org" schemaLocation="http://myserver/mySoapApp/service/soap?xsd=http://www.c.org/c.xsd" />
...
</schema>

Someone faced similar behaviour and knows how to fix that?


Mit freundlichen Grüßen / With kind regards,
Julien Charon

Avitech GmbH
Engineering AxL
Tel.: +49 (0)7541/282-177
Fax: +49 (0)7541/282-199
e-mail: julien.charon@avitech.aero<ma...@avitech.aero>
________________________________________________
Avitech GmbH
Principal Office: Bahnhofplatz 1 | 88045 Friedrichshafen | Germany
Court Registration: Amtsgericht Ulm | HRB 728293
Geschäftsführer/Managing Director: Antonio Maria Gonzalez Gorostiza
http://avitech.aero<http://avitech.aero/>

This message may contain confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.


Re: schemaLocation not correclty replaced in xsd

Posted by Daniel Kulp <dk...@apache.org>.
What version of CXF?   Can you try with 3.1.1?   There were a few fixes in this area very recently so this might already be fixed.

Dan



> On Jun 15, 2015, at 4:50 AM, Julien Charon <Ju...@avitech.aero> wrote:
> 
>  Hi all,
> 
> 
> I have a webservice running on tomcat and wanted to do some basic tests using SOAP UI. The tests failed because at some point SOAP UI wasn't able to correctly handle XSDs that are referenced from the WSDL. I took a deeper look at the behaviour and realised that not all schemaLocation attributes in referenced XSDs are replaced correctly.
> For example, assuming schema A is referencing schemas B and C, only reference to B is replaced correctly:
> <schema>
> ...
> <import namespace="http://www.b.org" schemaLocation="b.xsd" />
> <import namespace="http://www.c.org" schemaLocation="c.xsd" />
> ...
> </schema>
> 
> Is replaced to:
> 
> <schema>
> ...
> <import namespace="http://www.b.org" schemaLocation="http://myserver/mySoapApp/service/soap?xsd=http://www.b.org/b.xsd" />
> <import namespace="http://www.c.org" schemaLocation="http://myserver/mySoapApp/service/soap?xsd=http://www.c.org/c.xsd" />
> ...
> </schema>
> 
> Someone faced similar behaviour and knows how to fix that?
> 
> 
> Mit freundlichen Grüßen / With kind regards,
> Julien Charon
> 
> Avitech GmbH
> Engineering AxL
> Tel.: +49 (0)7541/282-177
> Fax: +49 (0)7541/282-199
> e-mail: julien.charon@avitech.aero<ma...@avitech.aero>
> ________________________________________________
> Avitech GmbH
> Principal Office: Bahnhofplatz 1 | 88045 Friedrichshafen | Germany
> Court Registration: Amtsgericht Ulm | HRB 728293
> Geschäftsführer/Managing Director: Antonio Maria Gonzalez Gorostiza
> http://avitech.aero<http://avitech.aero/>
> 
> This message may contain confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.
> 

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


AW: schemaLocation not correclty replaced in xsd

Posted by Julien Charon <Ju...@avitech.aero>.
Ok, so here's what I found out:
1. Some of the imports/includes are correctly replaced because they are directly used in the wsdl:types part of the WSDL. All others are not replaced at all. 
2. For the others, I had to patch org.apache.cxf.frontend.WSDLGetUtils.updateSchemaImports(Bus, Schema, String, Map<String, SchemaReference>, String, String) so that, for includes, the target namespace of the parent schema is used to build the schema URI. Otherwise, the relative references to schemas remain as they are and client applications cannot work with the schemas.


Mit freundlichen Grüßen / With kind regards,
 
Julien Charon

Avitech GmbH
Engineering AxL
Tel.: +49 (0)7541/282-177
Fax: +49 (0)7541/282-199
e-mail: julien.charon@avitech.aero
________________________________________________
Avitech GmbH
Principal Office: Bahnhofplatz 1 | 88045 Friedrichshafen | Germany
Court Registration: Amtsgericht Ulm | HRB 728293
Geschäftsführer/Managing Director: Antonio Maria Gonzalez Gorostiza
http://avitech.aero

This message may contain confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.

-----Ursprüngliche Nachricht-----
Von: Julien Charon [mailto:Julien.Charon@avitech.aero] 
Gesendet: Montag, 15. Juni 2015 10:51
An: users@cxf.apache.org
Betreff: schemaLocation not correclty replaced in xsd

  Hi all,


I have a webservice running on tomcat and wanted to do some basic tests using SOAP UI. The tests failed because at some point SOAP UI wasn't able to correctly handle XSDs that are referenced from the WSDL. I took a deeper look at the behaviour and realised that not all schemaLocation attributes in referenced XSDs are replaced correctly.
For example, assuming schema A is referencing schemas B and C, only reference to B is replaced correctly:
<schema>
...
<import namespace="http://www.b.org" schemaLocation="b.xsd" /> <import namespace="http://www.c.org" schemaLocation="c.xsd" /> ...
</schema>

Is replaced to:

<schema>
...
<import namespace="http://www.b.org" schemaLocation="http://myserver/mySoapApp/service/soap?xsd=http://www.b.org/b.xsd" /> <import namespace="http://www.c.org" schemaLocation="http://myserver/mySoapApp/service/soap?xsd=http://www.c.org/c.xsd" /> ...
</schema>

Someone faced similar behaviour and knows how to fix that?


Mit freundlichen Grüßen / With kind regards, Julien Charon

Avitech GmbH
Engineering AxL
Tel.: +49 (0)7541/282-177
Fax: +49 (0)7541/282-199
e-mail: julien.charon@avitech.aero<ma...@avitech.aero>
________________________________________________
Avitech GmbH
Principal Office: Bahnhofplatz 1 | 88045 Friedrichshafen | Germany Court Registration: Amtsgericht Ulm | HRB 728293 Geschäftsführer/Managing Director: Antonio Maria Gonzalez Gorostiza http://avitech.aero<http://avitech.aero/>

This message may contain confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.