Error: Cannot import wsdl:portType ... it does not match imported DataContract ...

Topics: General Discussion Forum
Mar 3, 2008 at 2:09 PM
Hi, when i try to use svcutil to generate a client, reusing types i get this error:


Command line:

{"
C:\Proyectos\DotNet\TFS\Juridico\Main\Source\Desktop\ConMega.Juridico.Presentati
on\ConMega.Juridico.Presentation\Service References>svcutil /r:c:\Proyectos\DotN
et\TFS\Juridico\Main\Source\Services\ConMega.Juridico.WinFormServiceManager\ConM
ega.Juridico.WinFormServiceManager\bin\Debug\ConMega.Juridico.Base.dll http://lo
calhost:4040/AbogadoService?wsdl
<P< A>
"}


Error:

{"
Error: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.Se
rviceModel.Description.DataContractSerializerMessageContractImporter
Error: Referenced type 'ConMega.Juridico.Base.EstructuraAbogado, ConMega.Juridic
o.Base, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' with data contrac
t name 'EstructuraAbogado' in namespace 'http://schemas.datacontract.org/2004/07
/ConMega.Juridico.Base' cannot be used since it does not match imported DataCont
ract. Need to exclude this type from referenced types.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/'
]/wsdl:portType@name='IAbogadoService'
"}

How can i find in wich way "does not match imported DataContract", the type is defined once in a only assembly..

If i remove te references option in svcutil command line the error goes away and files are generates, but types arent reused...

Any help please ?

Thanks
Mar 3, 2008 at 9:18 PM
I seems that you have some kind of type mismatch between your referenced asm and the types refs in your WSDL (type 'EstructuraAbogado').