(In VS 2010)
I can't add a service reference to a WCF service in a Windows Forms Project. When I go to add a service reference I click the "Discover" button. It brings up the service I want to add (within the same solution). I click the "OK" button. A server port starts (according to a popup dialog). And I get a Meassage box that pops up and says "There was an error downloading metadata from the address. Please verify that you have entered a valid address." Rats! I don't know what to do :( Now I did mess around with the WCF service project's Web.Config file before I tried to do this. I don't know if that would affect anything. Any help would be much appreciated!!
I have discovered an answer to my own question. Apparently you can get this error if you rename your service but don't change the service name in your .svc file.
Related
I have a WCF service that is running fine on our old IIS server. This service has both methods and Classes it exposes, all set up properly using [ServiceContract], [OperationContract], and [DataContract]. The service works fine on the old server. The service is only visible on our local intranet.
We are trying to move to a new IIS server. Other ASP.NET web sites work on the new IIS server. Now, in the client app code, if I try to "Add Service Reference" I am able to successfully add a service reference to the new IIS server. The problem is that while the methods work, the Classes from the WCF service are not visible on the client app. If I take an existing service reference and in the app.config file if I change the url to the new server, everything works. I looked at the WSDL files and both have the Classes in them.
I have checked the "Roles and Features" on both servers and do not see any difference in the relevant items. What am I doing wrong?
Ok so the link provided in the comment above actually solved it. Thanks Lex Li
stackoverflow.com/questions/3000209/service-reference-not-generating-client-types
when I took Abraham Qian's suggestion and tried to add a new service reference to the old server, it was doing the same thing as the new server, not showing the classes. This told me it was a visual studio issue. I then tried Lex Li's suggestion and that solved my issue. As a short recap of the fix:
When you add a new service reference, go to "Advanced..."
By default, "Reuse types in all referenced assemblies" is selected. Change this to "Reuse types in specified referenced assemblies"
In the box below that option, check "mscorlib".
Finish adding the service reference as usual.
Once I did this, it fixed my issues. Thanks for everyone's help!
I want to make an application that automatically deploys reports made in SSRS to the reporting server. I found that the best way to do this is by using SOAP.
I have been searching on this topic for a little while now and I don't see anyone saying how to add the SOAP API reference to a Visual Studio project.
This page page seems like it is directed toward the complete beginner with this API (which I am), yet it does not cover step #1 in actually using the API, which would be to add the reference. What using statement should I use, and/or what is the name and location of the DLL which needs to be specified, in order to start using the API?
I have never done it before until just now but it looks like you just need to add a Service Reference in Visual Studio. Since SQL 2008 R2 the URL looks like this:
http://server/reportserver/ReportService2010.asmx?wsdl
For more information see this MSDN page.
As mentionned by SMM, you simply have to add a web service reference to your Visual Studio project.
Go to "Project" menu, and click on "Add a service reference...".
Then put your SSRS service address in the window that shows as explained in previous post, and... that's it !
A new folder "Web reference" is now present in your project, with an item inside, representing the reference to the SOAP web service you add.
Let me know if you have some trouble.
Regards,
I have created WSDL file and when I add service reference in VisualStudio I can use it to fetch the data. However what I want to achieve is when I add service reference it should ask me for credentials by an authentication windows popping up.
What do I need to add to my WSDL file?
I am attaching link to my WSDL file.
Any help will be appreciated.
https://gist.github.com/anonymous/654fcddcdee2f9848500
There is no way to achieve this when you add a local Wsdl file in the IDE as a service reference to your project.
Unless you place the file on a network file share which will popup and ask for credentials.
Another way would be to host the Wsdl via an IIS web service with basic or windows authentication.
According to your comment you are accessing the WSDL using a URL. The question is this a WCF service endpoint? If so (MEX) meta data exchange is used to provide you the Wsdl. You can change the MEX endpoint to use https mexHttpsBinding. See following link:
https://msdn.microsoft.com/en-us/library/aa967391(v=vs.110).aspx
EDIT. I was adding it as a service reference instead of a web service reference (found by when adding a service refererence, go into advanced and down the bottom it should say "add web reference") , I didn't know that option existed as it's hidden away.
I made a web service in c# .net. Initially it wasn't calling because I thought that the web form didn't like the codebehind for the web form that is created in VS2012, so I took that out and just included the web service file itself.
I'm pretty sure the libraries were included when I visit the url of the service with wsdl, but it still won't seem to call the service to the form.
It displays some XML data and shows TestCypher as a workable service, so it should be working? I'm not entirely sure where the wsdl file should be hosted if I take the web service out of the solution
Please see the below link
http://www.codeproject.com/Articles/26941/Consuming-Webservice-In-A-Windows-Application
you can use this method in your application. I just post this example in your requirement.
please note : i have no guarantee about the perfomrnce area in this method.
So please consider this element when your application is use a wide number of users.
Hope it help.
I have a client that was successfully calling a webservice. the webservice was changed then the changes removed. but now the compiled c# winforms client cannot call the webservice.
Can I extract the wsdl the client is expecting to compare with the actual wsdl???
Yes. If you click the "show all files" button in your Solution Explorer, your web reference will then become expandable. The wsdl will then be viewable (expand the reference).