what to do?uploading of files in WCF C# - wcf

i've heard that WCF can upload files from one computer to another, my question is,
if i want to do this,
how can i tell computer1 the address of computer2?
thanks

Related

SSL Proxy / Decryption?

One of my clients just received the software ordered from his chosen developers, asked me to look at it and prepare the hosting procedures.
It's an Java (jar) app, so far so good ... but I saw something suspect, every 60 minutes or so the software connects to a remote host :443 port using SSL and transferring ~ 3-10 MB of encrypted data (as POST) then closes the connection, this is very strange. Tried to wireshark it but everything is encrypted and I have no clue about what kind of data is transferred, I know only the destination hostname. The hosted data within the app will be highly sensitive (insurance-broker) and if my client decides to go with it - this is a serious issue for his business and also for his clients, I've asked the developer company about this and they said that no one added something like this even if I provided them the proff (pcap).
I can block it within firewall, but if they added something like this it could exist another hosts ready to receive the encrypted data.
The only way I can figure it out is to somehow decrypt the SSL traffic in order to read RAW data and give my client all the needed informations in order to talk with the developer company to sort it out, how can I do that ? With some sort of ssl-proxy or whatever ... tried to google it but didn't find any kind of relevant tutorials.
I have access to the physical machine which is running the Java application, I can see every single bit of the traffic but ... encrypted.
If I was in your place instead of trying to decrypt ssl connection would have tried following steps:
1)Since you are aware of the host to which it is making a post request , find out more about that service so as to learn what it does ? May be try contacting that site saying that we need to consume your service what should I send my in post request ;)
2)Second way around would be if you can decompile the jar file and find line in the source code which makes that request and then you could go back to the developer asking as why this has been written. To find the source code which is making the call what you could do is block the host access on your firewall.
The code would fail and mostly probably he would have logged the exception in his log files. Find the stack trace and you will know the line of code that is
making that request.
Hope this helps.

WCF - Saving configuration

I'm relatively new to WCF so please forgive the rookie question. What I'm struggling with is trying to get my WCF service to remember its configuration at the service level. I'm happy that I've modified my Web.Config within my WCF project correctly, but now I want to modify the Client.dll.config and have it save. I am able to edit it happily, either by following the path directly to the file or by using the tool, but it never retains the settings. Why??
Thanks in advance
Ian
Perhaps when you recompile the client solution, the Client.dll.config file is reset. Try to update the App.config file in your client solution.

Log4Net doesn't write when iis hosting WCF service

Log4Net doesn't write when iis hosting a WCF Service.
it works great when i use the self hosting ( Visual Studio Development Server),
but when i run it using the IIS it doesn't write anything.
i read about this prolem and the conclusion is that
it must be a permission problem, but i don't know how to solve it.
how can i check that i have a permission to write a log file?
where can i change the permission? change AppPool users?
Can you give me some simple steps of how to check if i have a permission problem?
i'm an administrator on my computer.
i'm trying to create the file in the project folder.
The file is a rolling file appender.
thank you.
For my IIS hosted WCF services with HTTP endpoints, logging to App_Data has proven to be the easiest solution.
<file value="App_Data\log.txt"/>
You need to make sure the AD user that the application pool is running under has create/read/modify privileges to the directory where you're outputting your log files. By default, as far as I know, your app-pool user can't create/modify files. So it sounds like you're on the right track.
Edit: Here is an article to help you determine who your app-pool is running as, if needed.
I ran into a similar situation with Enterprise Library not writing to a file using the Logging Application block for an ASP.NET application. This was EntLib 4.1, the eventual solution after trying ACL modifications was to assign the App Pool to run as Network Service and the text logging commenced, not saying this is your solution, or the best one, but its worth a try.
From my experience, in IIS 7+ you have to make sure the application pool has permission to write in the particular log directory. For example,
The problem was solved when i moved the path of the log from "c:\Log.txt" Hard drive to "c:\log\Log.txt" folder in the hard drive.

what files to give client for .wsdl

thanks for any assistance.
I'm creating a wcf web service for an external client.
The client is requesting a copy of the wsdl.
I currently am waiting on being able to provide the client with access to the service.
when I go to my local webserver running the service (http://localhost/Services.svc?wsdl) I am shown
the wsdl, the data provided contains the method signatures (from the .svc code behind),
but does not contain the included model objects (Customer, Order, ext).
To get those objects, I can find the references in the shown data and go to the url
For me to provide all needed information to the client, so that they have the entire wsdl
should I provide the main schema and also each of the imported schemas?
or is there any other way of accomplishing this (other then the client hitting a server)
ie: is there a way of packaging all of them within one file?
(Seems like something would be available to extract each of those files?)
If I were to give a .zip with each of the files, would that be enough?
Thanks,
Steven
WCF packages up its WSDL and XSD (XML schema to describe the data being sent around) into various pieces, as you've already noticed. Those are referenced from your main WSDL with additional href's.
Or even better: you can run the "svcutil -metadata" command on the command line against the DLL or EXE which contains your service implementation - this will create all the needed files (typically several WSDl and several XSD) in the directory where you run the svcutil command. That's usually a more reliable way than piecing together the WSDL and XSD files from the ?wsdl URL (you usually end up missing one or two files).
Marc
If you manually downloaded each and every sub-WSDL and XSD referenced, then yeah, it would work; but it's cumbersome, to say the least.
An option worth looking into would be to use Christian Weyer's WCF extensions for flattening your WSDL so that WCF generates everything in a single file, then giving that to your client.

SMTP server that saves all mail to a folder? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Are there any free SMTP servers that just accept the mail sent through them, and save it to your hard disk, without sending it to the recipient. I would like to use this for testing my applications. Instead of just waiting around for the mail to go through, it would be nice if all emails could just be dropped in a folder, so that I can look at them. I could put some hooks into my program to just save instead of sending the message, but I don't think it's a full test, if the code follows a different path. Are there any existing applications like this?
I figure this would be really helpful, because you could test the mail abilities without needing to wait for the mail server to deliver it, and so that you can code while you're offline, and don't have access to an actual mail server.
[EDIT]
I'm specifically using .Net, but I'm not using the default SMTP mail handling classes in .Net, because of how limited they were in .Net 1.1. We are using a third party library (chilkat). I know that things have changed since then, but the code is stable and works, so no point in rewriting against the .Net API now.
I would like something that works as an SMTP server specifically because I could use it in the future for whatever projects I worked on, no matter the language.
You can use the standard smtp settings in your app or web.config and just specify what folder you want the emails to go.
<smtp
deliveryMethod="specifiedPickupDirectory"
from="from address">
<specifiedPickupDirectory>Your folder here</specifiedPickupDirectory>
</smtp>
This allows you to simply store the emails without an smtp server
Papercut
Neptune
SMTP4Dev
Dumbster
DevNull SMTP
Taken from this question.
On windows you could use IIS server's default SMTP server. Add an alias to its domain for * (wildcard) should cause it to drop all mail forwarded to it into its drop folder.
It's fairly easy to do in sendmail or postfix - just configure the local delivery agent to be 'cat >> file'.
bit late on this one, but have you tried ssfd?
you can put it on your machine or on a network server, catches e-mails and pops them in a directory
There is the python DebuggingServer as well part of the standard library :
http://docs.python.org/library/smtpd.html#debuggingserver-objects
it will print everything on stdout.
Don't know about such "fake" SMTP servers, but in .NET you can force SmtpClient class to save outgoing mail to the specified directory.
I am years late to the party but this works great for me.
http://emailrelay.sourceforge.net/
Having the .net email client just save the email and not send it
does not answer the question if your code works. To tell if it works
you must actually send it.