WCF / ASMX :: Dynamic Web Service / Not Getting Property "ConfigurationManager" To Change The Url?
Sep 23, 2010
am also using the console application as a web service client... I was unable to have the URL property until I followed ur steps given (Add web reference thro Advance)...
but I am stuck in the next step, I got the url property but I am not getting the property "ConfigurationManager" to change the url..
If i want to use Property & Method in same class then how to use it. I want to keep separate class only for interface , not for property. Also we have tried with [OperationContract] before get ,set in Service class . it solved our issue but throws error while run a .svc file
I have created WCF Application in vs2010 and using it in window application . i have added WCF service reference using "Add Web service Reference" from visual stuio. i want to do it by programming.
I have web project and class projects. one of the Class project has web reference. and i am consuming it in web project.Question: can I change class projects web reference url depending on environment DEV, Release, Test?Question: While in runtime why does not web reference's url take value from app.config?(it is taking value from Settings.settings.)
I inherited a old WSE 3.0 service. I am building an ASP.NET client for it. It is returning a MTOM response so my client is complaining. Does anyone know of a way to change the response type to XML? Or change my client to accept MTOM? I just want this crap to work.
public dynamic GetReferenceTableData(string tableName) { try { dynamic tableData = ReferenceTableDAL.GetReferenceTableData(tableName); return tableData; } catch (Exception ex) { throw; } } method at DAL(ReferenceTableDAL): public static dynamic GetReferenceTableData(string tableName) { Database db = DatabaseFactory.CreateDatabase(Flags.ConnectionStringKey); DbCommand dbCommand = db.GetStoredProcCommand("USP_GETTABLEDATA"); dynamic objDynamic = null; if (tableName.ToLower() == "a") { objDynamic = new List<A>(); } else if (tableName.ToLower() == "b") { objDynamic = new List<B>(); } else if (tableName.ToLower() == "c") { objDynamic = new List<C>(); } try { db.DiscoverParameters(dbCommand); dbCommand.Parameters["IN_TABLENAME"].Value = tableName; DataSet dsTableData = db.ExecuteDataSet(dbCommand); if (tableName.ToLower() == "a") { foreach (DataRow dataRow in dsTableData.Tables[0].Rows) { objDynamic.Add((A)dataRow); } } else if (tableName.ToLower() == "b") { foreach (DataRow dataRow in dsTableData.Tables[0].Rows) { objDynamic.Add((B)dataRow); } } else if (tableName.ToLower() == "c") { foreach (DataRow dataRow in dsTableData.Tables[0].Rows) { objDynamic.Add((C)dataRow); } } } catch (Exception ex) { throw; } return objDynamic; } @ Aspx try { using (DataServiceRef.DataServiceClient petService = new DataServiceRef.DataServiceClient()) { dynamic tableData = petService.GetReferenceTableData(tableName); //tableData is null ,exception } } catch (Exception ex) { throw; }
There is no exception at dal or service end when i debug list gets filled ok but when returns to aspx error at aspx(no exception gets caught at @ service) but exception at aspx i.e:
Message:The underlying connection was closed: The connection was closed unexpectedly. Stack Trace: at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
if i have the web application with many pages like add order page, edit order page, and delete order page actually they also interact with the Sql Server 2008 and i also create web service page call Sales_Service.asmx. i know just i need to put something like query into Web Method in Sales_Service.asmx but i have a lot of queries, i don't know which query i should put into it and how the web page call the Sales_Services.asmx
A customer reported that our asmx web service is continually increasing in memory (mem usage as well as private bytes). We are able to reproduce the problem in our lab with Windows 2003 Server SP2 (fully patched) on some of the machines. The customer is using Windows 2008.
We created a Hello World web service targeting the 2.0 framework built under VS2005 SP1 and a test client that continues to call it. The memory increases steadily - approximately 40K per client request. If the test app is paused, the memory remains the same. When it is closed, the memory drops. Explicit calling of GC.Collect does not drop the memory.
We have run the memory profiler on the service and the leak is all native memory. We have uninstalled/re-installed the Framework on one of the machines but no difference. To our knowledge all of the security and IIS settings are not modified. We have compared app pool, default web site and virtual directory properties to machines that have no problem and they are identical.
I have a .net app developed in .net 4.0 version. And I implemented an asmx web service in this. Now I want to call one of the webservice method in another classis ASP application java script function.
Is it possible to run a web service as a particular user/service account in the same way a Windows service can?I have a service account used for connecting to the DB and want to run the webservice under this account as the users using the webservice won't have DB access.The way I see to do it is to include the Impersonate option in the Web.config file, but is there any better way to do this?
How to create an instance of web service without adding web service reference? How to identify the server address/name where the web service is hosted from C# code?
My WCF Client calls my WCF Service which then calls ASMX Web Service. The problem is i have configured my wcf client and wcf service to windows credentials type but when wcf service calls asmx service the user credentials (default windowsidentity) is not passed to asmx service.
In WCF Service i am able to get user identity by using : Thread.CurrentPrincipal.Identity.Name; WCF Service - i have disabled anonymous access and enabled windows authentication. ASMX Web Service - i have disabled anonymous access and enabled windows authentication. WCF Service Config [Code]....
i have created a normal web service and i want to host it outside IIS. one idea i got is to use window service as hosting environment. i have created a web service and hosted it window service and its window service is running now.would anybody please let me know that how can i call web service hosted in window service binded over soap.tcp. here is my sample code.
I am keep getting an error that "Service Error : wbsTest failed" where wbsTest is my webservice.
The error comes up frequently enough for the user - normally reproducible within a minute or so of working with an application.
A bit of background: An user is a remote user accessing application hosted on our servers over https. He is software firewalled and his connection isn't the fastest but it is responsive enough. When errors do not present themselves, page loads are fairly quick.
I am writing a program to measure the latency(response round trip time) for a web service. I need to have this at client side.
My initial plan is to store the time at which request is sent and then calculate the difference in time when we recieve a response from the web service. Is this the correct way to measure latency of web service. This has some overhead because of storing time and all. How can this be done?
Another option is to attach a timestamp with the SOAP request. But the server should return the timestamp. This will not be possible in case of third party web services.
I want to know if MaxConcurrentSessions property means that only 10 (default value) users can enter my application (active session) if I define InstanceContextMode persession or this means requested at a given time.
I have a page with a textbox. User enter the WCF Service URI and my program get the method names and the parameters. Then user enter the values and I want to dynamically call the method with passed parameter values.
how can I dynamically set the value of a property for a given object? For example: I have a method GetInfo(string name, Color favcolor) where name is string and favcolor is of System.Drawing.color type. How can I set the color attribute dynamically with user supplied value.
[Code]....
The last line is currently throwing an error
Object of type 'System.Drawing.Color' cannot be converted to type 'System.Drawing.Color'.
Some strange problem have occured while developing application. Some WCF webservice returns object with date property.On client this web service is called using Jquery.ajax.Then result is parsed using json2.For date I simply use following expressions: var reMsAjax = /^/Date((d|-|.*))[/|\]$/; a = reMsAjax.exec(value); if (a) var b = a[1].split(/[-+,.]/); return new Date(b[0] ? +b[0] : 0 - +b[1]); unfortunatelly if browser timezone differs simple new Date with milliseconds not works.Time will be based on timezone.