Frage

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.

War es hilfreich?

Lösung

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...?

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top