Tom McDonald
Tom McDonald

Reputation: 1892

svcutil wsdl Error: The type name: on the property:"Name" of type:"System.CodeDom.CodeNamespace" is not a valid language-independent type name

When I use the Service Model Metadata Tool I get the following error

svcutil wsdl Error: The type name: on the property:"Name" of type:"System.CodeDom.CodeNamespace" is not a valid language-independent type name.

when I execute the following line

svcutil my.wsdl /n:*,"www.abc.com/x" /out:my.cs

the namespace "/x" is the source of the error but I can't fix it. I can change the namespace in the source document to "www.abc.com" and it works, no error, but that's not a solution as I don't own the source wsdl and can't change it to what I please.

Upvotes: 1

Views: 1675

Answers (1)

TheGeneral
TheGeneral

Reputation: 81473

As pointed out by DavidG www.abc.com/x is not a valid namespace

ServiceModel Metadata Utility Tool (Svcutil.exe)

Specifies a mapping from a WSDL or XML Schema targetNamespace to a CLR namespace. Using '*' for the targetNamespace maps all targetNamespaces without an explicit mapping to that CLR namespace.

To make sure that the message contract name does not collide with operation name, you should either qualify the type reference with ::, or make sure the names are unique.

Default: Derived from the target namespace of the schema document for Data Contracts. The default namespace is used for all other generated types.

Short Form: /n Note: When generating types to use with XmlSerializer, only a single namespace mapping is supported. All generated types will either be in the default namespace or the namespace specified by '*'.

Upvotes: 1

Related Questions