Matan L
Matan L

Reputation: 1027

Connecting to a wsdl in .net

I am trying to connect the following service :

http://api.affiliatewindow.com/v4/AffiliateService?wsdl

I did the following :

  1. Created a new empty web application (c# visual studio 2010)

  2. Right Click on the solution -> add service reference

  3. Pressed "GO"

  4. 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

Answers (4)

RandomUs1r
RandomUs1r

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

Patrick D'Souza
Patrick D'Souza

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

I4V
I4V

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

Ali
Ali

Reputation: 808

I did the steps you described above, without any errors using VS2012. Check your internet connection and firewall configuration.

Upvotes: 0

Related Questions