Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaToWs share types

I have a server in Java which has some web-services. WSDLs (and XSDs) are generated from java using javatows from apache cxf.

Some services share types, and I would like to share these types also in wsdl is it possible?

After that I want to generate c# code using svcutils, but because in each WSDL are some copies of the same types svcutil tell error that this complex type has already been declared...

I know that I can use /namespace switch but I do not want this because that way I will have the same classes generated in different namespaces... I would like to have one class in common namespace...

like image 351
Dusan Plavak Avatar asked Nov 22 '13 14:11

Dusan Plavak


1 Answers

I suggest you create a common.xsd file (if possible) containing the shared structures which are then included in each WSDL file for each one of the services.

<include schemaLocation="common.xsd"/>

I believe that will overcome the problems you're having when generating client proxy code with svcutil.exe.

like image 53
altosaxwannabe Avatar answered Oct 17 '22 08:10

altosaxwannabe