Can't display a WSDL for a WCF service hosted in an ASP.NET MVC application - wcf

When I launch the application and go to the service page I see...
You have created a service.
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:
svcutil.exe http://localhost:26109/DashboardServices.svc?wsdl
You can also access the service description as a single file:
http://localhost:26109/DashboardServices.svc?singleWsdl
But when I click on those links I don't see the WSDL. Instead I just get the same text.
I assume this has something to do with MVC routing, but I don't know how to fix it.

This behavior happens when you forget to put [ServiceContract] on the interface.

Related

How do I add a WCF Service Reference for my .NET Core App (.NET Framework)

I'm only using a .net framework with it and I can add a pure c# project that contains the service reference - but I can't create a Service Client with this approach, it tells me it cannot find an endpoint with the proper values
(Contract, Endpoint name, both are identical to the endpoint I copied over to my web.config.)
Is there a specific procedure in which you can add a service reference when it comes to ASP .NET Core? or is it just like regular .NET Framework?
Thanks in advance.
There are multiple ways to access wcf service, If you have control over wcf service implementation side. you can change your service to restful wcf service. if you don't have access to that use seviceutil.exe to get proxy class and config file.
1. first copy code from proxy class.
2. second add class reference to your ASP.NET code behind.
Check how to use serviceutil.exe on google.
Also go to http://www.wcftutorial.net/ for more details.

How can I use SimpleType in a WSDL data contract?

I use a wsdl file to generate web service with the help of svcutil but it generates class instead of simple int or string parameter for the service contract.
What I did:
I created a WCF Service Application
I created a Console Application then added the service reference to the project
I used svcutil.exeto generate service from thy wsdl and xsd files in console project
Why does it do that and how I can rewrite the wsdl to solve this problem, please?
Most likely you used /messageContract switch in svcutil.
If you added service via service reference, then right click on service->configure service reference and uncheck Always generate message contracts

HOw to manage newly added methods into WCF service

I have created wcf service and added its refernece into web application project.
Have added as below way: 1. generated proxy and config file using - svcutil command and added proxy file into web application project and merged configuraiton file.
Now, I have added some new methodsinto the wcf service , do i have to use - SVCUTIL command on each time or it should work automatically.... for now, i need to generate proxy file each time.. please suggest some best way.
NOTE: service instance available into ASP.NET web applicaiton (client) but unable to get when use client as - MVC applicatoion. please suggest.
Thanks
In the Web Application, open the Service References folder.
Right click on the Service you want to update.
Select Update.
Thanks for the response.
I found the answer, when add service reference (for MVC application) >>> click at 'Advance' button >>> uncheck the "reuse object....." option and then add it.
Then, service client reference is available and it works.
Just for KS, sharing you another design issue due to Add Service Reference option at below link:
What should keep into this design approach
Thank You

consuming standard SOAP Web Service using vb.net

I have consumed several wsdl services successfully, but am stuck now with this web service.
Am implementing Hotelston webservice which state :Hotelston.com API is a standard SOAP Web Service (WS) available at URL
http://www.hotelston.com/ws/HotelService?wsdl
I cant access the direct code of the webservice after i added the it as a reference in my application.
Please see the following MSDN articles for the exact details on how I added and used these web service references but still cant access it from the direct code.
How to: Add and Remove Web References
How to: Call a Web Service
For full API documentation of wsdl file through the link.
If you show all files in the project and expand the service reference out, Reference.cs is empty. This is likely because there are namespace errors in HotelService.wsdl ("ax23", specifically) that is causing the t4 template to fail to generate the service code. Bottom line, it's their fault, not yours.

How to use a WSDL File to create a WCF Proxy?

I have an old WSDL file and I want to use WCF to communicate with the service.
The WSDL is generated from a ASMX (I suppose but I am not sure).
What would be the required steps to communicate with it ?
Right-click your project, and choose "Add Service Reference". Point to the WSDL. Click "Ok". That should be all.
Use svcutil.exe to create a WCF proxy to call the service. Details here.
wsdl.exe is the old web service (1.1) way of creating a proxy. The first thing to try is "Add Service Reference" as already mentioned. This uses svcutil.exe to create the proxy. If you need more control over how the proxy is created, you can use svcutil.exe from the command line with a variety of switches.
With that said... I have had trouble with older web service wsdls. In particular, an old Apache AXIS Web Service containing overloaded operations. Please see my post here for complete details. (My problem still isn't solved. I hope you don't encounter the same issues, but if you do and figure them out, please answer my question. :)