VS 2008 - Log Web Service Calls
Nov 12, 2011
I've got a web app running with purely web services like these:
Code:
<WebMethod()> _
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=False)> _
Public Function EditService(ByVal toddtype As String _
, ByVal fromddtype As String _
[Code] ....
And I want to log each web service call. I don't want to bother my database with this log - I would prefer to have the web app log to a text file on the web server itself.
How would I open and access a log file like this from a bunch of web services? Does web app still have application startup like events???
View 1 Replies
Similar Messages:
Feb 18, 2010
I have a SOAP web service and I'm trying to figure how to save/log the last 10 requests for each user. Each user is required to send their user/pass in each request, so it's easy to know who the request originated from. With these last 10 requests saved, my goal is to develop some sort of page that will allow them to log-in with their credentials and view the raw request, the actual SOAP message, http header information, and anything relevant that I can think of.
The point is to allow people to troubleshoot their own connection issues instead of having to contact me each time they can't connect, have trouble formatting their request, etc....
My first thought was to store all this information in memory in a hashtable or something, but that may have scalability issues when we have hundreds/thousands of users hitting the web service.
We could use our database to store these requests. Instead of hitting the database each time, I may need to create some "buffer" mechanism that will only update the database after the buffer gets to a certain number of requests. Is there an existing library or mechanism that will do this?
We can't store these requests on the file system on the machine hosting the web service. Since these requests can potentially contain sensitive information, it's a business decision that I'll need to work around. Or maybe there's a better way to achieve what I'm trying to do?
View 2 Replies
Jul 29, 2010
Are web service calls synchronous or asynchronous by default? How is synchronicity determined, by the service or by the client?
I have code similar to the following:
try
{
string result = MakeWebServiceCall_1(); // this is a third party webservice
[code]....
In the above, SetStatus is writing to the same tables that the third party web services read from. If I change the status before both web service calls have completed, it's going to make a big mess and I'm going to get fired. How do I know/ensure that the webservice calls are synchronous?
View 1 Replies
Sep 23, 2010
I'm trying to make API calls to a service provider. I've never tackled JSON requests before but I want to give it a go - as they seem less verbose than XML. Could someone be kind enough to give me a simple example here?
My confusion stems from some libraries I've come across. Do I need to add any libraries to my project? Or is it just a matter of creating a string that complies with JSON syntax and send it via a WebRequest?
View 3 Replies
Nov 18, 2010
We have a page that makes a request to a 3'rd party web service. When under heavy load this response time extends significantly, however the 3'rd party reports back that there times for processing remains constant. There timings show that from the time they receive a request to the time they send it back is always around 1.5-2.0 seconds. Now we are experiencing wait times of over 20 seconds. My understanding of ASP.NET is that each request will run on a IIS thread pool thread and make the request to the 3'rd party service return and process. So I don't really understand what could be blocking on our end. Is there something I am missing?? Is there a threshold limit beyond IIS that is blocking?
If I am missing something a physical book recommendation that covers this subject would also be a very welcome addition to any answer.
View 2 Replies
Oct 5, 2010
This is quite straight forward. I'm calling a web-service (.asmx, with session enabled) from a c# application. I want each call to be with the same session key as the previous one (as opposed to creating a new session key each time).
Here's my (nothing-out-of-the-ordinary) code:
[Code].....
View 3 Replies
Apr 17, 2010
I am successful in using the AutoCompleteExtender control by make use of web serivces as the data source (ServiceMethod) to the extender control. My question is do we have any way in assining a code behind method as data source to this control.
removing the ServicePath url and assiging code behind method to ServiceMethod attribute will resolve the issue.
View 4 Replies
May 4, 2010
We have a WCF service (BasicHttpBinding) which will always fail after 30 seconds. Calls under 30 seconds complete without error. Anything over 30 seconds will fail with a 502 Bad Gateway exception:
System.Net.WebException: The remote server returned an error: (502) Bad Gateway.
But yet the WCF call continues to run in the background (and will eventually complete). We have confirmed that the BasicHttpBinding - Binding - sendTimeout (in web.config) is greater than 30 seconds (actually set to 5 minutes). We confirmed this both on the client and the server.
Here is the full stack trace:
System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (502) Bad Gateway. ---> System.Net.WebException: The remote server returned an error: (502) Bad Gateway.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
[Code]....
where this 30 second "timeout" is coming from or why a 502 Bad Gateway error is returned?
SOLUTION: We are using the IIS7 Application Request Routing Module which has Proxy settings of its own. The Proxy settings have a default timeout of 30 seconds. Increasing this to 600 seconds (10 minutes) solved our problem. The Bad Gateway error is not completely correct but WCF Trace Viewer (see answer) helped see that the problem was not the service itself but an issue in between the client and the wcf service.
View 1 Replies
Nov 22, 2010
We have a custom Ajax checkbox control. In that control we set value (from inside the control) via a web service call (say WSCall1) to the business engine. There is also an event exposed on the OnClick of checkbox for the end user to have their custom code where the end user have their own web service call (say WSCall2). This event that end users will write is handled inside the ajax checkbox control on the "OnSuccess" of the internal web service call (i.e WSCall1) with an expectation that if WSCall1 succeeds, WSCall2 will get executed. This works fine with Firefox and Chrome but not in IE. In IE sometimes WSCall2 gets executed first and then WSCall1 -- actually there is no gurantee which web service gets called first. For WSCall1 we have used " Sys.Net.WebServiceProxy.invoke"
Is there a way we can make sure that WSCall2 gets only executed on the "OnSuccess" of WSCall1? Isn't the OnSuceess supposed to be executed when the WSCall1 thread returns?
View 1 Replies
Jan 20, 2010
I can't seem to call a web service method from Ajax with both POST and GET.
Initially only the POST would work and GET would causes this error:
{"Message":"An attempt was made to call the method u0027getDatau0027 using a GET request, which is not allowed.","StackTrace":" at System.Web.Script.Services.RestHandler.GetRawParams(WebServiceMethodData methodData, HttpContext context)at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext
context, WebServiceMethodData methodData)","ExceptionType":"System.InvalidOperationException"}
I fixed that by adding this attribute: [ScriptMethod(UseHttpGet=true)] but now GET causes this error:
[code]....
So is it true that you can only use either POST or GET and not both from Ajax?
View 3 Replies
May 26, 2010
I have to show the time taken for a service call in Perfmon from my ASP.Net application. For this, I have added a stopwatch which starts at the service call start and stops at service call stop. Now I have a custom counter which user AverageTimer32 to log the stopwatch values to Perfmon. My question is, how can I show the service names on the Perfmon graph. I am using windows XP (I know windows server perfmon has some fancy stuff).
View 1 Replies
Sep 3, 2010
I haven't deployed behind a load balancer before. My customer has a WCF service built and tested on servers using a service model configuration that is relatively straightforward. It provides a service to return an image of a map for another application. To get the map, it calls other services.
The service was built in Visual Studio 2010 targeting the 3.5 framework. The customer is using IIS 7.5 and an F5 load balancer. When moving to the production server, the Web.config was changed to add the load balancer behavior and specify the endpoint to show the physical and logical address of the service:
[Code].....
There was a problem when the service was deployed to a server behind the load balancer. When I try to call the service from WCFStorm or WebServiceStudio I get the message "The provided URI scheme 'https' is invalid; expected 'http'.
The endpoints for the service itself look right to me. However in the development and testing versions of the config, the client section uses http instead of http, while on the production servers it uses the load balancer's https address. This seems like it should be obvious, but we're missing it.
View 1 Replies
Sep 14, 2010
Here is how my system is set up:
A web service using ASP.Net web service The web service has a web method with EnableSession=true
A client which refers to the web service using "Service References" (note: not "Web References")
The app.config of the client has allowCookies=true
[Code].....
The call to AppendUpload returns false, because of the mismatching session ids. Why is that?
As far as I can see, I have the right attributes for the web method, the client has the correct config, and the same instance of the proxy is used.
View 1 Replies
Jun 3, 2010
This question may have been asked before, but I'm looking for a different answer than what I've seen.
Our website is in ASP.NET and we use the model-view-presenter pattern to get business logic out of the markup codebehind.
Is there an accepted pattern for web services for getting business logic out of the codebehind? It seems like putting the logic in a 'presenter' is misleading since the calls don't really present anything to the user, and may not even send back data to the client.
View 1 Replies
Jun 11, 2010
So I've got my jquery autocomplete 'working,' but its a little fidgety since I call the webservice method each time a keydown() fires so I get lots of methods hanging and sometimes to get the "auto" to work I have to type it out and backspace a bit because i'm assuming it got its return value a little slow. I've limited the query results to 8 to mininmize time. Is there anything i can do to make this a little snappier? This thing seems near useless if I don't get it a little more responsive.
[Code].....
View 5 Replies
Jun 6, 2010
I have a WCF service returning JSON to jQuery ajax calls and presenting the results on an ASPX page. When the page is NOT under SSL, the ajax calls work perfectly. When the page IS under SSL, the calls fail. I understand that this behavior must be due to the Same Origin Policy (SOP).
So, how do I setup my WCF service to accept calls from an SSL-secured page? Does the WCF service also need to be secured? If so, how do I do this?
View 3 Replies
Oct 8, 2010
I am trying to update client side controls asynchronously with information from a service.
The service I am using has a callback delegate that points to the users web page (server side)
I would like to update information on the page that is initiated by another users also consuming the same service. exactly like a chatroom.
I am trying to use an update panel, and call updatepanel.update() (server side) once I recieve the information from the service. basically: how do I partially update control data from the server side so that client side can see it.
View 1 Replies
Jul 19, 2010
If I declare a public variable in my module then publish it out on the server...then have multiple users using the app will the variable get overwritten each time a user calls it?
View 1 Replies
Feb 17, 2010
I have the following Page_Load function...
protected void Page_Load(object sender, EventArgs e)
{
XmlDataSource1.Data = GetXmlFromFile(Request.QueryString["file"]);
XmlDataSource1.DataBind();
Repeater1.DataBind();
}
The page in which this Page_Load resides is called by a parent page. Each time this Page_Load gets called the value of "file" in the query string will be different. So each time I will be receiving the XML contents from a different file which are inserted into the XmlDataSource and then bound against by the Repeater. Getting the XML data from the file works great but when I bind against the repeater that only works the first time through Page_Load. Each time after that when this code is executed the same results from the first XML file are displayed in the repeater.
What am I missing here. How can I get the XML data to be bound against the repeater on each page load instead of just the first one?
View 3 Replies
May 10, 2010
I have a webservice (ASP.NET) deployed on a webfarm. A client application consumes it on daily basis. The problem is that some of its calls are duplicated (with difference of milliseconds). For example I have a function Foo(string a,string b). The client app calls this webmethod as Foo('test1','test2') once but my log shows that it is being called twice or sometimes 3 or 4 times randomly. Is this anything wrong with the webfarm or the code? Note that the webmethod has simple straighfarward insert and update statements.
View 1 Replies
Feb 24, 2011
That is what I have to do: Send XML to a web service. I have preliminary requirements of what I have to generate in the XML. So, I just create this big, long XML stream and send it to the service? I would like to read a little bit about this to educate myself. Do you have a good link, or can you voice your opinion of this one,Additionally, I am coding in VB.NET so I will have to convert that code if it is a good example.
View 15 Replies
Jan 31, 2011
I have a webservice.
I would like to get the log on user id.
I am using the following code.
During runtime, it gives error saying "Request is not available in this context".
HttpApplication context = new HttpApplication();
string username = context.Request.ServerVariables["LOGON_USER"];
How do I get LOGON_USER in a webservice.
View 1 Replies
Jan 6, 2011
I have two web services on two different servers communicating
WS1.asmx
Code:
<%@ WebService Language="VB" Class="WS1" %>
Imports System
Imports System.Web
Imports System.Web.Services
Imports System.Xml.Serialization
Imports System.Net
Imports System.IO
' 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)> _
Public Class WS1
Inherits System.Web.Services.WebService
Dim IP as String = "192.168.0.174"
<WebMethod()> _
Public Function Function1(ByVal s1 As String) As String
Dim ReturnString As String = ""
Try.........................
View 11 Replies
Jan 16, 2010
I am having some trouble with my web service. I want to make a variable that will be the same for each thread running. To be specific, my program is that user 1 goes on my page and types something into the textbox and that user 2 can see what user 1 is typing into the box. its sorta like google wave. The problem is that when i run it, the variable's value does not go to user 2 and instead another instance of that variable is created.
View 18 Replies
Mar 5, 2011
Is it possible to have a web service print to a network printer that is not attached to the server running IIS. This is for an enterprise application run on an intranet site. I've used impersonation and adjusted the settings on the Web Service but I still get an error message.
Settings to access printer "printer name" are not valid.All solutions i've googled have not worked. Also, I'm attempting to print to both laser / label printers.
View 3 Replies