3

I'm trying to code a .NET client for the cleverreach API ( WSDL file: http://api.cleverreach.com/soap/interface_v4.php?wsdl , documentation at http://api.cleverreach.com/soap/interface_v4.php ) in Visual Studio 2010.

The problem is that no matter what I do there doesn't seem any way to create C# code for this API.

I've tried both ways - adding a service reference and a web reference. In both ways there was no code generated for the methods of the API (something like createList or addBatch).

I've also tried using the command line instead:

svcutil.exe /language:cs /out:GeneratedProxy.cs /config:app.config http://api.cleverreach.com/soap/interface_v4.php?wsdl

This just gives me an error message:

Generating files... Warning: No code was generated. If you were trying to generate a client, this could be because the metadata docu ments did not contain any valid contracts or services or because all contracts/services were discovered to exist in /reference assembl ies. Verify that you passed all the metadata documents to the tool.

When I look at the WSDL file in a web browser, the methods I am looking for (createList for instance) are mentioned. So I am not sure what is going on.

What I'd like to know:

  • Why can't Visual Studio create the client-side code for this web service?
  • How can I work around the problem?

Thanks,

Adrian

Adrian Grigore
  • 33,034
  • 36
  • 130
  • 210

3 Answers3

2

Most likely, the reason you didn't get any code is because the WSDL is not valid. Simply opening it in XMLSpy tells the story:

Invalid XML schema: 'Attribute 'firstname' is not allowed in element <xsd:element>'

That's on

<xsd:element name="firstname" type="xsd:string" firstname="registered"/>

You might want to contact the vendor and ask them what they were thinking.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
1

This is a bit old, but in case it helps anyone, I was able to use the wsdl.exe tool as described in Create web service proxy in Visual Studio from a WSDL file:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>wsdl http://api.cleverreach.com/soap/interface_v5.1.php?wsdl

Of course it doesn't help that the wsdl appears to have errors.

Community
  • 1
  • 1
Philip Pittle
  • 11,821
  • 8
  • 59
  • 123
0

This is my first stack overflow answer so I apologies if it is not to the usual standard.

I have tested the service using visual studio, I created a new Project (.Net Application) added the service at this URL "http://api.cleverreach.com/soap/interface_v4.php?wsdl". Please note you WILL need the query string '?wdsl'), by adding a web reference I may have misunderstood your URL in your post but it looked like you were removing this.

I validated the WSDL file. I tested in VS 2008 and will test again in 2010.

Hope it helps :)

Graham Smith
  • 25,627
  • 10
  • 46
  • 69
  • worked fine in VS 2010 Ultimate edition for me, you still having issues? – Graham Smith Mar 08 '11 at 14:50
  • Adding the reference is not the problem. The question is: Can you do something with the API after adding the reference? It did not generate any client-side code for the functions exposed by the API for me. If it does work, could you post some example code on how to call, say, the function addBatch exposed by the API? – Adrian Grigore Mar 08 '11 at 15:25