I can usually test my web application on my PC. (In "production" it's on a web hosting server.) But now I have a callback page (.ashx) and am not sure how to proceed - How do I have my application receive the callback? Is there some way to have the callback page redirect to my PC? Some way to have my PC receive callbacks and specify the callback address as my IP (I can chose any callback url I want.)? Maybe some other way?
I don't need to actually attach it to the debugger, only to see the results.
If your ASHX file is in an ASP.NET Web application or website, you can host it locally with IIS or visual studio and then call it with Fiddler (www.fiddler2.net)
Using fiddler you can make calls to your ASHX and pass any payload required.
I don't know your network environment, but depending on how flexible it is, you could set up dyndns or a static domain so that your callbacks actually reach your PC.
I don't love it, but it's a logical solution. Then once you've got everything working properly, you update the domain in all of your call backs to point to production, and you should be ready to go.
Related
I need to get the calling app's URL because the service sends emails that contain links to my app (e.g. click here to view the form).
I'm considering just hard-coding the app's URL in 1 place on the service, but when working locally the local host port will sometimes change. Also, when deploying to different test environments I would have to change the URL. Also, working with others will pose a slight problem too.
The best solution would be to determine it dynamically. Second best, web.config. Third best: hard code it.
How can I resolve this and get the calling app's URL?
Edit: it's impossible to send the url from the client because the service has a timed event to send email notifications.
maybe the IP Can help
try this line
((RemoteEndpointMessageProperty)OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name]).Address;
this article can help on the long way
http://keyvan.io/detect-client-ip-in-wcf-3-5
EDIT
getting the URL is not possible,
Similar question here
Can I get the WCF Caller Url...?
We have a Win32 application that connects to a third party application to send some info to it. That application has a web service that we call its methods. One of its web methods is called GetDevices and when our application is calling it, it will fail to work and I have no idea what are the details of this failure. So we should write a small diagnosis application that can create some detailed log files to know what is going, send it to them to run it and then we may know what is going on with more detail. Now do you have any ideas what is a good way to write such a diagnosis application for this debugging purpose?
If this web service is using HTTP (either SOAP or REST) you can use Fiddler to snoop the HTTP traffic and see what's happening.
When web requests are made, the request (and response from the server) will show up in Fiddler, and you can use that to determine why it's not doing what you expect.
I have an application that users were complaining that it hangs when the user trys to perform a certain action. I found it that it is hanging in a web service call. The web service is running on a remote server. I can't figure out how to debug into the web service through VS when the code is on a remote server.
How do I find out in the web service where exactly the code is hanging?
If you don't have access to the source of the web service then you're not going to be able to "debug" it. If you want to try to externally debug it then you can create a page that sends various inputs to it (some that should work, some that should error out, etc). You can then access this page in a browser that has developer tools (I would recommend Firefox w/ Firebug or Google Chrome) and then look at how long the calls are taking. Google Chrome will show you how long it took to send the request, how long it waited, how long it took to receive, etc. If it IS the actually web service and you don't have access to it then it would be odd that you were responsible for fixing this issue. I have a feeling though, if this is a robust web service, you're going to find that you're either having a networking issue or your sending it some invalid input or something along those lines.
If you do have access to the source code then simply run the web service locally and point your local version of the application at the local version of the web service. Any breakpoints you put in the web service will hang the application and you will be able to step through it just like you can non-web-service code.
In your own code, take a look at what is going on with the web service call. e.g Does it throw a fault? Timeout? Does it ever return a successful response? If not, are you sending valid data?
If the web service call is successful but just slow, consider how you might make your application appear to be more responsive. One possibility is to use Asynchronous Programming.
I'm writing a C# application to control the windows tomcat service. I need a way to get some sort of event when tomcat finishes starting after I run the service. (i.e. all the apps deploy.)
I can read the log file and wait for the "Server startup in" message but it seems like there must be a less messy way. I know you can register a lifecycle listener using Java but I can't think of a way to do something similar with C#.
Does anyone know a good way to monitor tomcat with C#? Thanks in advance.
Edit: In case I wasn't clear, simply checking the status of the isn't sufficient since it will report "Running" during the startup time while the apps are being deployed and it isn't yet accessible.
Unless there's a reason you can't do so (permissions, etc) I would just issue a web request to the service and wait until it comes back.
Even if you don't want to give the account hosting the service permission to use the app(s) in question, you can still create an app that only it has permission to use, and have it call that.
I ended up writing a tomcat wrapper in Java which acts as a lifecycle listener. The C# application launches the java program and receives lifecycle messages through a named pipe.
I am building a Httphandler following these instructions here
It manipulates HTTP POST and HTTP GET. I have a client with two buttons two POST and GET.
After i've tested and happy everythings working I move it from localhost to IIS. Now when I do this I get an exception in the POST handler code.
How on earth can I debug this code line by line? I managed to do this awhile ago, I thought it was by attaching to process but I can't work it out. I can emulate GET just by typing address in browser, post im not sure about. I've tried telnetting and sending it from there but haven't had any luck.
Attach visual studio debugger to asp.net worker process. It must work that way. You must attach to right worker process that is running your app as there may be multiple instances of asp.net worker process.