Reputation: 1027
I am trying to connect the following service :
http://api.affiliatewindow.com/v4/AffiliateService?wsdl
I did the following :
Created a new empty web application (c# visual studio 2010)
Right Click on the solution -> add service reference
Pressed "GO"
Changed the name to AffWinAPI and pressed OK
I get the following error : "Failed to generate code for the service reference 'AffWinAPI'. Please check other error and warning messages for details."
I tried the solution suggested in the following and it still haven't worked for me.
Service Reference Error: Failed to generate code for the service reference
What does this WCF error mean: "Custom tool warning: Cannot import wsdl:portType"
Any advice ?
Upvotes: 0
Views: 6160
Reputation: 4190
The way I've added web services in the past is via this method:
http://msdn.microsoft.com/en-us/library/bb628649.aspx
Notice the use of the advanced button to reach a screen that says add web reference. This will get you the asmx file and class reference you need to use your web service.
Upvotes: 1
Reputation: 3573
In the Advanced dialog of Add Service Reference in Visual Studio, there is a check box "Reuse types in referenced assemblies". Can you un-check it and try adding the service again?
Upvotes: 0
Reputation: 35353
Yes, I got the same error but managed to add it as WebService
Add Service Reference/Advanced/Add Web Reference
If It asks to save, then save it to a folder and add reference using that file
Upvotes: 4
Reputation: 808
I did the steps you described above, without any errors using VS2012. Check your internet connection and firewall configuration.
Upvotes: 0