Search code examples
c#web-servicessoapwsdl

Error when trying to generate service reference from wsdl


i got a folder with a WSDL file (and all the xsd files related to it) but i can't seem to generate a web service from it using the "Add service reference" option in VS2013 (also tried in 2008 just to test). I'm using .net 4.0.

i get multiple error such as:

Custom tool error: The global type ('WarningType') has been defined in both
'file:///D:/WSDL/AMA/2011Y/chameleon/AMA_CommonTypes.xsd' and 
'file:///D:/WSDL/IATA/2010.1/chameleon/IATA_CommonTypes.xsd'. 
They are different at './simpleContent/extension/@base'.

so, i was advised to use "Add Web reference" tool.

this works for some reason. i get no errors now.

But, the problem is that i found out that a web reference do not support WS-Security /WS-Adressing (someone wrote this as a comment in how to add SOAP Security header) and i MUST specify in the header those elements. Also, i keep reading not to use a web reference since this is an old technology.

So, does anyone know how to solve the errors I'm getting ?


Solution

  • There are multiple tools that generate service proxy objects. Apart from using Add Service Reference you can use command line tool svcutil.exe which is included as part of the visual studios installation for generating service objects.

    Here is how to do this http://msdn.microsoft.com/en-us/library/ff623148.aspx

    This alternative command line approach will help you resolve issue related to WS-Security / WS-Adressing.