making a web service ? How to make its WSDL? - asp.net

I am making a web service and I am new to web services. Please guide me how to make WSDL for my .Net web service ( it is no WCF service).
Please also guide me where I will place WSDL file, on client or server side ? where I will place WSDL file.
Thanks

MSDN : Web Services Description Language Tool (Wsdl.exe)
use Wsdl.exe utility in visual studio 2008 for web services
you must run that tool from command prompt ,
Start - > all programs -> Microsoft Visual Studio 2008 - > Visual Studio Tools -> Visual Studio 2008 Command Prompt

To generate wsdl file, you must use wsdl.exe from visual studio command prompt. But if you expect to use wsdl in your solution projects, in visual studio, you can click on project, choose add web service/service reference -> choose your service from solution or url and then VS automatically generate all file for you

Use Wsdl.exe as suggested by Pranay Rana and put it on the server.
To access web service on a client .Net side create a service reference in visual studio to get the client proxy.

It sounds like you're just using ASMX based webservices, correct?
If you want to generate a WSDL on an ASP.NET/ASMX site, you can run the web application and hit the ASMX URL with the querystring "?WSDL". So if your service name is
http://myserver/myservice.asmx
then you can hit
http://myserver/myservice.asmx?wsdl
Save the page locally and you can send it to whomever needs it. Exposing the WSDL is enabled by default, the person or company who needs to consume the WSDL can generate it by hitting the URL as well.

Related

How to run asp.net webpage on the localhost

I am just learning asp.net and have created a simple webform on visual studio. How I can run this on the localhost(xampp). Like HTML you simply put files to the server folder and it works. But when I copy all asp files it simply shows me source code?
It is stupid question but I really need answer...
ASP (ActiveX Server Pages) is a deprecated technology (superseded by ASP.NET). Thus support is not included as standard in IIS. But it can be added by using Server Manager under Roles | Web Server (IIS) and scrolling down to Role Services.
If you however mean ASP.NET then, initially, look at the Web tab of the project properties and start in VS for debug and test. Once that is working you'll need to read up on deploying ASP.NET on MSDN.
To host a ASP.Net page you usually use IIS. You are supposed to run IIS on your server and host the ASP.NET website on the IIS Management
This Article on MSDN should help you with that.
Also, you usually use visual studio to 'Publish' to the server folder, rather then copy and paste the files. In case you didn't do this: this is done by right-clicking the project in visual studio and selecting 'Publish'. Then there are a few options, you can publish to a folder (File System) and then move the published project to your server, or publish it straight to your server.

How to publish Asp.net Web Application from a Web Service or Windows Form App(Not from Vs editor)

I am working on a project and we need to deploy our web projects to server but these web projects are creating dynamically by end users. so we gather all files of web project in a file. finally we need to push these files to server with publish. but how can i do without VS editor's manual publish option. do u have any website or any source that example to my aim, or if you know sth about it can you help me?
You can use Visual Studio in command line mode to do the same but assuming that you probably do not have access to VS on, your next bet would be MSBuild.
See these links that tells how to use MSBuild to publish a web project:
http://blog.m.jedynak.pl/2008/03/publishing-web-application-with-msbuild.html
How do I publish a Asp.NET web application using MSBuild?

ASP.NET MVC 4 and Web API in Azure - No HTTP resource was found

Using Visual Studio 2012, I created a simple Windows Azure Project (Cloud project) for which contains a ASP.NET MVC 4 website. I didn't change anything to the template and I simply try to deploy it using Azure Website. I imported the "publishing profile" from Windows Azure Dashboard into my project and deployed (using Visual Studio).
At the very end of the deployment process I am getting the following message: "failed to open 'http://mysite.azurewebsite.net'. Exception:Class not registered". I can only click "Ok" on that dialog. Any idea why I am seeing this message?
When I look at the Output Window, I see that the deployment succedded. I go the a Web API url and I am getting "No HTTP resource was found that matches the request URI 'http://mysite.azurewebsites.net/api/values'". What puzzle me is that I can access that same url on my local environment.
What am I missing? Thanks!
I could access using my Azure website using ASP.NET Web API. If you use default MVC4 Web API template, please access "http://[yoursite].azurewebsites.net/api/Values/".
My Environment is below.
- Visual Studio 2012
- ASP.NET MVC4
You don't need to create a cloud project to use Azure Websites. You can simply create an MVC app and then use git deploy or even FTP to push the site to Azure
Make sure that you referenced the latest version of WindowsAzure related assemblies in your project.
Microsoft.WindowsAzure.Diagnostics 2.0 (and not 1.8)
Microsoft.WindowsAzure.ServiceRuntime 2.0 (and not 1.8)

Visual Studio - 'Browse UDDI Servers' -> 404?

I have a ASP.Net application which implements a web service. Within the ASP.Net application there's a test script which consumes the web service and it all works etc.
I have built a .NET console application and want to 'Add a Web Reference' so that the console app can consume the web service provided by the ASP.NET application. When I use the 'Browse UDDI Servers on the local network' to do that any plausible URL I use results in a 404.
I'm guessing I need to do something to my ASP.Net application so that it acts as an UDDI server ? Does anyone know what ?
Update
I just wanted to clarify something - I'm not desperate to use UDDI it just seems that's the only option in my circumstances which are :
I'm actually doing this for another developer who is used to using Visual Studio to do this stuff
The other developers system will need to run on another machine within the same network.
OK I'm going to answer my own question here.
The key thing for me was that I didn't need an UDDI server in the first place - instead what I needed to do was to simply supply the 'Add Web Reference' dialog box with the URL for the .ASMX file within the ASP.NET application which defined the service I was after (and ignore the whole 'Browse UDDI Servers' thing). (I've actually done this before but was having a bad-brain day today)
More generally however if I did wish to use UDDI the answer I wanted appears to be here MSDN Forum post dated July 2007 -
> How do we add the UDDI server that we
> created to the local network? ...
> Just found where to do that :
>
> - Go to the UDDI Service Control MMC
>
> - Right click on the server and go to properties
>
> - Go to the "Active Directory" Tab
>
> - Click "Publish"
UDDI is a dedicated service on the network for registering Web Services and also for discovering/consuming web services. Think of it as a directory of web services for a local intranet.
Windows Server 2003 includes UDDI Services. You have to install it via Add/Remove -> Windows Components (similar to IIS, FrontPage Extensions, etc.).
If the problem is having a single repository of web services that can be discovered, then UDDI is a solution.
If the problem is using a single service on another machine, then just referencing an endpoint (asmx/svc) will suffice. UDDI is overkill in that scenario.
For the record, the OP did not actually want anything to do with UDDI. His assumption was false. UDDI is not actually used for anything.

Runtime Error with referenced WCF Service

I have created a reference to an IIS hosted WCF service in my ASP.NET website project on my local workstation through the "Add Service Reference" option in Visual Studio 2008. I was able to execute the service from my local workstation.
When I move the ASP.NET web site using the "Copy Web Site" feature in Visual Studio 2008 to the development server and browse to the page consuming the service, I get the following error:
Reference.svcmap: Specified argument
was out of the range of valid values.
Has anyone experienced this same error and know how to resolve it?
EDIT: My development server is Win2k3 with IIS 6
The problem may be due to a mismatch with the solution/project folder structure and the IIS web site folder structure. I ran into similar problems a good while ago and ended up changing how I deploy web services. Here and here are some discussions of similar problems to yours, they ended up not using the Add Service generated client and rolled their own client. Also, I can vouch for using the "Publish web site" method for deploying my services. Here is a good article on web service deployment models.
#Sixto Saez: I was able to use the following resource similar to the one you provided to generate a proxy class using the ServiceModel Metadata Utility Tool (svcutil.exe).
Here is the exact command line:
svcutil /t:code http://<service_url> /out:<file_name>.cs /config:<file_name>.config
Here is the reference I found that suggested using the method.
Also, I was able to consume the service by creating a reference using the Visual Studio 2008 "Add Web Reference" command. It generates code based on .NET Framework 2.0 Web Services technology.
Unforunately, the WCF service web site and I can not use the svcutil solution (Unless you know of a way how...). Do you deploy you service or your web site with the service reference using Visual Studio 2008 publish web site feature?

Resources