469,280 Members | 1,811 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,280 developers. It's quick & easy.

How to deploy a webservice in IIS ?

Hi,
I've developed my web service using VS.net 2005 and .net 2.0.
I am able to test my service on my own PC. Now I need to give it to the
testing team wherein they will test it on a clean PC.
What are the files I need to give to the testing team? On my PC, in IIS I
dont see any exe. Only the asmx and the code behind files are there.
I dont want to be giving out my code....so what do I do?

Sinex
May 16 '07 #1
3 33083
"Sinex" wrote in message
news:Ol****************@TK2MSFTNGP04.phx.gbl...
Hi,
I've developed my web service using VS.net 2005 and .net 2.0.
I am able to test my service on my own PC. Now I need to give it to the
testing team wherein they will test it on a clean PC.
What are the files I need to give to the testing team? On my PC, in IIS I
dont see any exe. Only the asmx and the code behind files are there.
I dont want to be giving out my code....so what do I do?
Give them the .asmx files and the files in the bin directory of your web
service project.

I just tried right-clicking a web service project and using Publish... I
chose to publish to a file location only the files needed to run the
application. It did a pretty good job, copying only the bin directory and
the files marked with Build Action = "Content".

The only problem I see is that it copied _everything_ from the bin
directory, including files that didn't belong there!
--
John Saunders [MVP]
May 16 '07 #2
Hi,

Another alternative is to create a setup project that you can hand to your
testing team. In this way they can merely run your setup and all the required
files will be installed. Should you want the setup to also create the IIS
virtual directories so that your web service is ready for a client
application then here is some code that you could use. This should be run on
the project installers "AfterInstall" event so that you have the install
directory.

Dim IISSchema As System.DirectoryServices.DirectoryEntry = Nothing
Dim CanCreate As Boolean = False
Dim PathCreated As Boolean = False
Dim IISAdmin As System.DirectoryServices.DirectoryEntry = Nothing
Dim VDir As System.DirectoryServices.DirectoryEntry = Nothing
Try
IISSchema = New System.DirectoryServices.DirectoryEntry("IIS://"
& sWebSite & "/Schema/AppIsolated")
CanCreate = Not
IISSchema.Properties("Syntax").Value.ToString.ToUp per() = "BOOLEAN"
If CanCreate Then
Try
IISAdmin = New
System.DirectoryServices.DirectoryEntry("IIS://" & sWebSite & "/W3SVC/1/Root")
If Not System.IO.Directory.Exists(sPath) Then
System.IO.Directory.CreateDirectory(sPath)
PathCreated = True
End If
'If the virtual directory already exists then delete it
For Each VD As System.DirectoryServices.DirectoryEntry
In IISAdmin.Children
If VD.Name = sAppName Then
IISAdmin.Invoke("Delete", New String()
{VD.SchemaClassName, sAppName})
IISAdmin.CommitChanges()
Exit For
End If
Next VD
'Create and setup new virtual directory
VDir = IISAdmin.Children.Add(sAppName, "IIsWebVirtualDir")
VDir.Properties("Path").Item(0) = sPath
VDir.Properties("AppFriendlyName").Item(0) = sAppName
VDir.Properties("EnableDirBrowsing").Item(0) = False
VDir.Properties("AccessRead").Item(0) = True
VDir.Properties("AccessExecute").Item(0) = True
VDir.Properties("AccessWrite").Item(0) = False
VDir.Properties("AccessScript").Item(0) = True
VDir.Properties("AuthNTLM").Item(0) = True
VDir.Properties("EnableDefaultDoc").Item(0) = True
VDir.Properties("DefaultDoc").Item(0) =
"default.htm,default.aspx,default.asp"
VDir.Properties("AspEnableParentPaths").Item(0) = True
VDir.CommitChanges()
'INPROC = 0
'OUTPROC = 1
'POOLED = 2
VDir.Invoke("AppCreate", 1)

Return True
Catch Ex As Exception
If PathCreated Then
System.IO.Directory.Delete(sPath)
End If
End Try
End If
Catch ex As Exception
' Error handling
Finally
IISSchema.Dispose()
End Try

"Sinex" wrote:
Hi,
I've developed my web service using VS.net 2005 and .net 2.0.
I am able to test my service on my own PC. Now I need to give it to the
testing team wherein they will test it on a clean PC.
What are the files I need to give to the testing team? On my PC, in IIS I
dont see any exe. Only the asmx and the code behind files are there.
I dont want to be giving out my code....so what do I do?

Sinex
May 21 '07 #3
The answer to this question

can be found here:

http://en.csharp-online.net/Creating...irectly_to_IIS
Nov 8 '11 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Andre Boeder | last post: by
2 posts views Thread by John Spiegel | last post: by
1 post views Thread by Nalaka | last post: by
3 posts views Thread by Mark Jerde | last post: by
reply views Thread by Saish | last post: by
4 posts views Thread by Amirallia | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.