C# code to delete a file from FTP through Proxy - asp.net

How do I get around this error
**The Requested FTP command is not supported when using HTTP Proxy**
occur on the following code
ftpWebRequest.Method = WebRequestMethods.Ftp.DeleteFile.
It is urgent. Can anyone give suggestions for this problem

Your proxy might be blocking FTP delete keywords when filtering requests.
Can you check if you are able to do this activity when not in the proxy (try from a different network where you connect directly).
if yes, i dont think it is straighforward for you to do this activity from behind proxy.
Another solution is to try open source ftps libraries http://ftps.codeplex.com/
or
1. Create a WCF service on the FTP server which allows you to do all that you want.
2. From client side make call to the WCF service passing the command.

Related

Connect to web application protected by GlobalProtect with custom HTTP requests

Our company CRM web application does not have an API and therefore is extremely cumbersome to use when having to upload data as this all has to be done manually and through the GUI. To access this application you need to be identified in GlobalProtect. My idea was to use http requests sent directly to the server to try to circumvent the lack of an API.
However, i have been very unsuccesful as copying http request out of the chrome devtools and changing their payloads using Postman resulst in an ECONN_RESET error. I am no networking expert, but i believe this error has to do with the fact that the application is protected by GLobalProtect and there is more communication necessary with the server to make it accept my modified http requests.
Is there anyone with knowledge about networking and GlobalProtect that could point me in the right direction towards setting up a direct communication with the server? Thanks so much!

Requested action aborted: Access violation at address 005F6DB2 in module '***.exe'. Read of address 00000000

I am using Apache Jmeter to send FTP load on a Server. After setting up the FTP request on specific IP and port, I get this error:
Requested action aborted: Access violation at address 005F6DB2 in module '***.exe'. Read of address 00000000
I know that I have all the access and I don't know why a module can block me, although I know that software (***.exe) is not blocking my ports. What is the problem?
Here is the attached Wireshark screenshot from the server when sending the clients request, the red line is the problem and it occurs in different places each time I run the test.
The problem doesn't seem to be related to JMeter
Try uploading file(s) using "normal" FTP client like FileZilla or WinSCP.
If the problem persists:
try identifying its cause using Windows Event Viewer
try to trace system calls using i.e. WinDbg
or just raise an issue on your application (FTP component)
If the problem does not occur on "real" FTP clients:
double check that your FTP Request sampler configuration is correct, see Load Testing FTP and SFTP Servers Using JMeter guide for details.
try uploading the file to the other, i.e. public FTP server to see if it works
try implementing file upload purely in Groovy using JSR223 Sampler. See FTPClientExample.java for the code you could re-use. Make sure you have the following line in your script:
ftpClient.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out), true))

Servlet on one tomcat passing data to another servlet running another tomcat server?

Hi i want to know if its possible to have data being passed to another servlet running a different server (example Tomcat host port 9090) from a servlet running on tomcat server (host port 9999)?
Doing a project in java using NETBEANS.
I have searched around and tried some of the snippets of codes like HTTP Request and HTTP Connection but to no avail. Is this really possible? If yes, can anyone give me some explanation or hints what to search for in google? Im stuck.
Technically, yes I think it would be possible but I can't even begin to think of why you would want to do something like that. In the first server you would need to use a URLConnection to perform a HTTP request on the target server and then gather the response manually. This would all happen inside the doPost / doGet method of first server and is explained here: Using java.net.URLConnection to fire and handle HTTP requests. This would get messy very quickly.
If you want to do interprocess communication have a look at web services they provide a much cleaner communication system and even work across different languages quite well.

Hosting WCF web service from a Remote Server

I have an WCF Webservice project, built in my local machine, which when hosted using test client and triggered, returns values from remote database in JSON format.
For example, if you key in the URL with localhost then you get results back in the below format:
{"Id":3,"Value1":"67.5687","Value2":"126.7125"}
I want to host this project on a remote server with a public URL, which should return the above results back from any network. I have 3 question regarding this:
** What modifications should I do to my current WCF project to host it on remote server.
** Given the various types of hosting like :
1) windows process activation services (WAS)
2) IIS
3) Self hosting
4) Hosting in a Windows service,
which type of hosting is best suited for hosting on remote server.
** What changes should I make in my App.Config file (including the change in my endpoint address from localhost to IP address) to make the service work.
Thanks.
1) You shouldn't need to make any changes to your project just because you want to host the code on another machine. I find this an odd question.
2) Given your choice of JSON as data format and a browser as test client, I'm guessing you want to make it available over HTTP using simple GET requests. In the Microsoft stack, IIS is the web server, and the natural choice for this scenario.
3) It is quite impossible to answer. I don't know what's in your app.config today. I don't know if you're going to authenticate, and if so how. And I don't want to know! That said, it seems to me if everything is supposed to behave as it does on your dev box, the bindings are already ok. I don't remember if a WCF service needs to know about the endpoint it is itself at (hard to see why it would need to know this, really); I would have thought it more natural to do such configuration on the host, e.g. IIS. The client of course should use a different endpoint pointing to wherever you host the service. (You can put many endpoints in app.config and let the user choose one, btw.)
I think most of us sin against the following advice now and then, but it is the best advice I can give: Read a book. Learn as much as possible about the thing you're using, in this case WCF. You'll get the time back later, and your software will be less bad!

Configure a WinHTTP application to use Fiddler

I need to see the actual requests being made from a asp page to the webservice(which calls another webservice). All these requests happen on the same local box. I ran the "proxycfg -p http=127.0.0.1:8888;https=127.0.0.1:8888" on the command prompt based on
http://www.fiddler2.com/fiddler/help/hookup.asp#Q-WinHTTP: How can I configure a WinHTTP application to use Fiddler?
I now see the webservice wsdl requests in Fiddler but not the actual requests. Would someone know why??
If your WS calls are going to your local machine, make sure the URLs they are using are "localhost." instead of "localhost" - notice the dot in the first instance. Otherwise fiddler never gets a chance to pick up the request.

Resources