Solved

Web Service - Without Precompile

Posted on 2007-03-30
7
597 Views
Last Modified: 2008-01-09
I know that aspx pages can be deployed so that they compile at run time.

<%@ WebPage Source="WebPage.aspx.cs" %@>  (or something like that).


I want to do the same thing with a web service.  I want to put the source code in the IIS directory and make a slight change to it - and have that change take affect without re-compiling everything.


Here are the contents of my current asmx page:

<%@ WebService Language="c#" CodeBehind="SecurityAccess.asmx.cs" Class="JournalSentinel.WorkflowGen.WebService.SecurityAccess" %>

how can I change this to compile at runtime instead of being pre-compiled?
0
Comment
Question by:_TAD_
  • 3
  • 2
  • 2
7 Comments
 
LVL 3

Expert Comment

by:Nico
ID: 18827371
instead of publishing the webservice, just copy the files to whatever location you want the project to be. .net will always compile stuff on the fly...
0
 
LVL 22

Author Comment

by:_TAD_
ID: 18828424
That works for .Net 2.0 applications, but I'm afraid this web service was initially compiled in .Net 1.1


In a nutshell, I was told to make a trivial change to the web service (changing an xml field name).  The problem I have is that I suspect before this is all done another 2 fied names will change and I don't want to recompile it for these trivial changes.
0
 
LVL 3

Accepted Solution

by:
Nico earned 250 total points
ID: 18828464
Hm, I guess you have to precompile anyway then. As far as I know the 1.1 framework doesn't doe on-the-fly compiling.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 22

Author Comment

by:_TAD_
ID: 18828514
aspx 1.1 supports non-compiled web pages.  A web service is just a different type of web page.


I'll keep looking.
0
 
LVL 12

Expert Comment

by:ShazbotOK
ID: 18836256
Honestly to allow the source files to be resident on a production server is dangerous.. this means any malicious access can be used to control your code.

better practice is to complile the Web Service methods and deploy (or copy) the DLL to the bin directory on production.   IIS will detect that the assembly has changed and reload it when it is accessed.
0
 
LVL 22

Author Comment

by:_TAD_
ID: 18836386
Security is not an issue.  This is not an outward facing web service.  If someone has gotten far enough into our environment to affect this web service, we have bigger problems then who authorized my vacation time (which is the purpose of the web service).
0
 
LVL 12

Assisted Solution

by:ShazbotOK
ShazbotOK earned 250 total points
ID: 18836431
I still stand on the "compile the code and import the assembly" - as this is the best method to use... (security or no security) and technically no the ASMX pages are not a "webpage" ...  if you open the ASMX into designer mode you will be able to note that it is only a "placeholder" so that the IIS knows to listen for that http request.. all communications are interpreted and sent to the aspnet_wp.exe listner wich calls the appropriate assembly.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with sorting data in Listbox using VB.NET 3 53
Combine two datatables into one based on a value from second datatable 4 32
Run time Error 4 34
SQL Exceptions 3 36
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now