Deploy web services

Nikko

Newcomer
Joined
Aug 11, 2003
Messages
11
Hello,

I'm new to web services and I just want to know what I need to deploy web services.

My web services will be write in VB.NET, C# or Java.

Thx
 
What exactly are you trying to do?

In VS.Net, you just need to create a Web Service Project in whatever language you are working in. From there, you'll probably want to change the .asmx file to something meaningful as well as change the Namespace from tempuri.org to your server or domain name.

From there, just add some Web-Methods to the class (by default, there's a hello world function you can play around with). Try to uncomment that, and compile the project. You should be able to set a web-reference to that project from another project (asp.net or win-forms, etc) and call the HelloWorld method and return a string to the caller.

Let me know if you want more detail or a specific scenario you're working on.
 
In that case, once you have tested everything locally, you can use the "Copy Project" button in the Solution Explorer to deploy to another server, use XCopy, or create a setup project for your installation (depending on your permissions on the server).
 
Ok thanks a lot.

But to run the web service (not on localhost), I must set it on a server web?
On this server, I must install the framework .net ?
 
Sorry to skip that, but yes, you'd have to have the .Net framework installed on the server. I just made the (incorrect) assumption that this was already the case.
And secondly, yes, your web service must reside on some sort of web server (IIS, etc).
 
Hi mocella,

You were saying the namespace needs to be changed from tempuri.org to server's name or domain name. I presumed the server's name means machine name. Am I right?

I'm currently trying out web services and I encountered a problem while trying to consume a web service on a remote machine. I keep getting the error "The proxy settings on this computer are not configured correctly for web discovery" on my VS IDE when trying to add web reference.

My test setup is quite simple. I've 2 machines connected up using crossed LAN cable. No domain, just workgroup. I've built a simple web service that return a string on one machine. The web service got deployed to the IIS by itself when I compiled the project. On the other machine, I tried building an application by adding a web reference.

Is there something else I've overlooked?

Thanks,
chew

mocella said:
What exactly are you trying to do?

In VS.Net, you just need to create a Web Service Project in whatever language you are working in. From there, you'll probably want to change the .asmx file to something meaningful as well as change the Namespace from tempuri.org to your server or domain name.

From there, just add some Web-Methods to the class (by default, there's a hello world function you can play around with). Try to uncomment that, and compile the project. You should be able to set a web-reference to that project from another project (asp.net or win-forms, etc) and call the HelloWorld method and return a string to the caller.

Let me know if you want more detail or a specific scenario you're working on.
 
To answer your first question, yes, you can just change tempuri.org to your server name where you host your web-service. In all actuality though, you can leave it as tempuri.org, but that's not a good practice if you're planning to deploy this to a production application at some point.

As for your second item, I'm not really sure why you're getting this. Perhaps because of the way you're setting up the network with just a piece of CAT5 between the two boxes. Does everything else work from a network perspective: drive-shares, etc?

A quick search of MDSN for your error message gave this article, but I'm not sure that this relates to your situation, but check it out:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vs_e_mustspecifyproxyserver.asp
 
Thanks mocella. I've got it fixed by adding the following lines to the web.config file.

<webServices>
<protocols>
<add name="HttpPost"/>
<add name="HttpGet"/>
</protocols>
</webServices>

I'm not sure what I'm doing. Got this solution from another forum. Maybe you can enlighten me. I'm wondering why can't visual studio add those lines for me. Do you have article that I can understanding the web.config file better?

Thanks,
chew
 
I can't say I've ever had to use that particular solution, so I'm not sure what that's about. Everything I've done has been within our corporate Domain, so maybe that's why I have yet to see this.

As for the web.config file, there's tons of stuff out there that you can read and do with this file that go beyond the base set of 5 or 6 that are added by default - stuff like storing sql-connection strings, etc. Try a google search for something like "web.config settings" or "web.config keys" or stuff like that and you'll probably be overwhelmed with all the info.
 
Back
Top