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

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

Command line:

on\ConMega.Juridico.Presentation\Service References>svcutil /r:c:\Proyectos\DotN
ega.Juridico.WinFormServiceManager\bin\Debug\ConMega.Juridico.Base.dll http://lo
<P< A>


Error: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.Se
Error: Referenced type 'ConMega.Juridico.Base.EstructuraAbogado, ConMega.Juridic
o.Base, Version=, Culture=neutral, PublicKeyToken=null' with data contrac
t name 'EstructuraAbogado' in namespace '
/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=''

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 ?

Mar 3, 2008 at 8: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').