Configuration :: Creating An Msi For A Web Service?
Nov 11, 2010
I am trying to create an msi for a Web Service. I want the web service to be installed as a 'Web Site' not as an 'Application' under Default Web Site in IIS. I have code that creates a web site, but when I try to add it as a custom action under the install node of the msi, the code isn't getting executed. Reading about installers, it seems that anything under the install node gets fired after the installer has already started, if that makes sense. I want to be able to create the web site before the installer actually begins the installation process so that when the user comes to the window where he/she has to choose the Site under which to install the web service it can already be listed there and they'll be able to choose it.
Excuse me this common error. I´ve found a lot of info in Google but I´ve not found my error. I´m trying to read some data from a custom section in web.config and I don´t know which is my error?
In Visual Studio 2005.I have created a Blank solutions(XYZ) and then add a ASP.Net Web Service Project(TESTP) under it.And then create a .asmx file(WEBFI.asmx) and then write a method and add [WEB Method] on top of the method.Now compile it.And then publish it.But in publishing folder I didn’t found any WSDL file which I should call in different machine (which is in LAN ).
I wonder if there are some differences between creating a WCF service and an MVC web-application. If you know of good links on how to create such a service for an MVC application that returns a JSON object please do post them.
I've looked around for some tutorials, but everything I see is how to use REST services with my app. But that's not really what I need, I'm not doing basic GET requests, the end user needs to do some complicated calculations with several classes and variables from my web service.
In a Web Forms app, I would just add a Web Services solution and do everything in there. Is that the recommended solution for an MVC app?
I am trying to create a web service application that will need to use .net 4.0 for my datamodeling and other things. I noticed in VS2010 when I select New | Project the "ASP web service app" option is available if .net 3.5 is selected in the combo box but if I change that to .net 4.0 the option goes away.
After researching the only thing I found was a message where someone suggested to use the WCF web service option. I have never dealt with WCF before so I have no idea what path that will lead me down.
Here is my concern... we have existing web services developed in .net 3.5 that are already in use and we have windows based client applications that are developed in Delphi (version 7.0 to be specific) that already talk to these web services with no problems and no special coding required. Delphi can simply import the WSDL which generates an interface unit that gets compiled in and away we go. This new service app I need to create must also be accessed via the same Delphi apps.
The current asp web service apps generate 4 files when "published": web.config, .asmx file and in a in folder there is a .pdb and .dll file.
Can anyone tell me if support for this type of web service app is still available via .net 4.0 and if so how do I create the project or is that something that has been discontinued and thus no longer possible?
I am new to the whole ajax/jquery/web service scene. I am trying to create a web service to pass back data for a jquery post and currently have two errors. It appears there are examples the web but must in c and looking for something in vb. Below is my web service. See in bold the error descriptions and in red the items visual studio is highlighting.
WordsService.asmx HTML Code: <%@ WebService Language="VB" CodeBehind="~/App_Code/WordsService.vb" Class="WordsService" %> WordsService.vb Code: Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.Runtime.Remoting.Services Imports System.Collections.Generic Imports System.Data.SqlClient Imports System.Data Imports System.Web.Script.Serialization ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. <System.Web.Script.Services.ScriptService()> _ <WebService(Namespace:="[URL] <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Public Class WordsService Inherits System.Web.Services.WebService Private _sConn As String = ConfigurationManager.ConnectionStrings("DB").ConnectionString
'1) Type 'ScriptMethod' is not defined.
'2) Value of type '1-dimensional array of String' cannot be converted to '1-dimensional array of 1-dimensional array of String' because 'String' is not derived from '1-dimensional array of String'.
<WebMethod(Description:="Gets the books matching part of a title."), ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _ Public Function GetBooksByTitle(ByVal strTitle As String) As String Dim myConnection As SqlConnection = New SqlConnection(_sConn) Dim objCommand As SqlCommand = New SqlCommand("SELECT * FROM table WHERE field like '%" _ + (strTitle + "&' ORDER BY field;")) Dim dsSearch As DataSet = New DataSet Dim sdaSearch As SqlDataAdapter = New SqlDataAdapter(objCommand) sdaSearch.Fill(dsSearch, "english") myConnection.Close() ' Create a multidimensional jagged array Dim JaggedArray()() As String = New String((dsSearch.Tables(0).Rows.Count) - 1) {} Dim i As Integer = 0 For Each rs As DataRow In dsSearch.Tables(0).Rows JaggedArray(i) = New String() {rs("BookNum").ToString, rs("Title").ToString, rs("Author").ToString} i = (i + 1) Next ' Return JSON data Dim js As JavaScriptSerializer = New JavaScriptSerializer Dim strJSON As String = js.Serialize(JaggedArray) Return strJSON End Function End Class
Here is the article I am currently following for example: How To Create A JSON Web Service In ASP.NET.
I am creating a singleton object in the first request to the web service and keeping it in the memory. This works fine for first few seconds. If I make a request 5 minutes later, I can see that the singleton object is created again? is my singleton object getting disposed after x no of minutes? how can i make increase the life-time of my object forever ?
public sealed class Singleton { static ServerInstance instance = null; static readonly object padlock = new object(); Singleton() { } public static ServerInstance Instance { get { lock (padlock) { if (instance == null) { instance = new ServerInstance(); } return instance; } } } ~Singleton() { #if DEBUG ExceptionFactory.Fatal("~Singleton() called!"); #endif } } [WebMethod] public string OnReceiveEvent(string objectXmlData, string objectType) { if (!Singleton.Instance.initServerComplete) { InitServer(); } return Singleton.Instance.OnReceiveEvent(objectXmlData, objectType); } public void InitServer() { if (!Singleton.Instance.initServerComplete) { Singleton.Instance.InitServer(); Singleton.Instance.initServerComplete = true; GC.KeepAlive(Singleton.Instance); } }
I am trying to simulate a sample web service payload similar to that which i will receive one the webservice is live. Can anyone help me simulate this?Criteria for my response will be:a bool pass or fail string - message and the object (in this case in the form of a list) heres the class I am to populate with sample data:
[Code]....
How can I use this class to put sample data in it? Lets say I want to put customers in the list 'ReturnObjects'?
I am creating new WCF service and i would like to do two way XML for communicating with third party vendors. My wcf service get the request from the outside program by means of URL and it should response accordingly.
Example - I have url which third party will call and put xml as a request, i have to get that xml, work accordingly and response back with either success or failure and appropriate xml. I need to make it completely automatic so anybody can call that url, it will validate that user and do the next step of request and response.
i am in the process of creating a restful service with WCF, the service is likely to be consumed by at least 500 people at any given time. What settings would i need to set in order to deal with this.
I'm facing a senario in which I want my logged in users can send requests to each other(Request generally is official request like request for resources, etc.).
And other user can get notification for new request(But this is not about e-mail notification).I want to use ajax. I have no idea how to start with. Please somebody help me with this. Simple example will be great to start with.
i had my code in .aspx page which i trnasfeered to the .asmx pageso i get error in few places in .asmx pageUnable to cast object of type 'System.String' to type 'System.String[]'earlier i had a label control which i hve replaced with a variable in .asmx pagelet me knw hoe to do the few modification to make it workingi hve the below code which gives me conversion frm string to string[] errorPrivate Shared errorList As List(Of String) = New List(Of String)dim msg as string
If errorList.Count = 0 Then msg="Sucessfully done" Else
In Visual Studio 2010, I don't see the Visual Studio installed template to create an ASP .Net Web Service Website (when I click on File->New->Web Site..) if the target framework is 4.0. However if I switch to FW 3.5 or lower, I do see the template.
I wont to restrict my web service only for few domains.
I wont to have access to web service from using ajax and my page, and I don't want that anybody can create client to my WebService and view my web service methods.
I get the following error which I don't get when I build a simple WCF Data Service in an non MVC project. I added the following to my global.asax:
[Code]....
The type 'MvcWebApp.WcfDataServiceTwitter', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.
I have to define a web method which will fetch XML documents from another web service based on the list of projects from the database. Now I need to send these XML documents in different SOAP envelopes. XML documents can be more than one.
My instructions for creating a new web service with VWD 2010 Express call for using the installed template, "AST.NET Web Service". But this template is not listed.
I would like to create a simple web service in visual basic, place it in IIS 7 on my desktop, and then consume it probably using a proxy class.
Is there another way to create a new web service in VWD 2010 Express?
We have created a new cname for our subdomain website. The new website is working properly with cname. We do have .net application inside the webiste which is not working with cname. For eg,1. http://servername/_folder1/app/mypage.aspx (Accessing .net application (App) website without cname)2. http://NewDomian.xxxx/app/mypage.aspx (Accessing .net application (App) website with cname)The first case is working perfectly, but when I access the second url, I got the following error.Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.Source Error:
Created a windows service for my local system for sending bulk mail and it is working.But the same if the want to access the db which is there in hosted server and want to install it in my local machine to access the db details from the server , is not working. While starting a service , it is stopping immediately. Is it possible to do so?