WCF service not invoked by client - wcf-client

I am working on my first WCF service and i am not sure why there are no results inspite of doing every correct.
Created a WCF service.Added a .svc page as well and now i can publish and browse to my service as well when it is hosted on IIS. Now i add service reference into a simple console application and create client object, provided values mandated by the data contract and then i do client.Operationname().
What is supposed to happen is that my service is supposed to send an email out to the email address i provided during my testing with a confirmation message.But that does not happen.
I enabled logging using SvcConfigEditor on the published config file, but there is no log entry.
I checked the logs of smtp and nothing is there as well.
I am running out of ideas as what else can i do to make sure that i am able to send out the confirmation email to the customer using my service. Also my service does work when i have it published on local machine.

Try to use WcfTestClient.exe from Visual Studio.Net Command-line to help simulate the client. then, You can debug the server side code.

Related

How do I find out the reason I cannot send messages to my bot?

I have set up a bot registration channel that connects to my bot's endpoint. It works perfectly fine in Bot Framework Emulator.
I am having problems connecting to my bot through the "Test in Web Chat" page on the Azure Portal. I try to send a message, but nothing happens and all I see under the message is "Sending".
I will then go to the "channels" tab in the blade and see an error for web-chat: There was an error sending this message to your bot: HTTP status code Unauthorized.
When I try sending a message to the bot in Microsoft Teams, absolutely nothing happens. I do not even get an error. Under health on the Azure Portal it just says "Running".
Getting my bot to work in the web chat is not top priority though. I really want it to work in teams in the end.
Wanted to comment but don't have enough points. There's a few different reasons for authorization. When creating the bot registration there's an option to 'only allow accounts from this organization', this needs extra configuration so if you picked this then change it to any account.
Also, you can often get more detailed error messages from the server's side (which aren't revealed to the user who gets hit with 403). Go to the bot's App service in Azure portal and go to "App Service Logs" near the bottom of the left menu. Enable "Application Logging (Filesystem)" (I also like to Level to Verbose and enable "Detailed Error messages" as well). Now go to "Log stream" in the left menu. It should now be connected. Try to access bot again and see what messages come in the log stream.
If you enable Application Insights that can also help
The main reasons for bots not getting called are either the address is incorrect (either the root location of some part of the address, depending on how you're hosting it. As an example, an Azure Function will automatically add an extra "/api" early in the path) or, as you're finding, something to with the AppId and AppPassword not getting picked up correctly.
If it's the latter, which is what it sounds like here, then in principle it's a simple fix - you just need to make sure your AppId and AppPassword are (a) correct from the portal and (b) getting used correctly in your bot configuration.
The problem comes in with (b) above - there are a whole bunch of different samples on the internet, from Microsoft and others, both for C# and Node, and they use a ton of different ways to instantiate the bot and set it's AppId and AppPassword. Some of the examples, for instance, use an implementation of an "ConfigurationCredentialProvider" internally, which will try pull the appid/apppassword from your configuration file, but of course expect them to be in a specifically-named set of values (see here for more).
So, can you check in however you've implemented your bot, to see where/how the credentials are getting set exactly?

Is it possible to set up an own push service within an intranet?

I would have asked this in a follow-up comment to this comment but my reputation is still too low.
So here are the questions: Is it possible to change the endpoint URL of a browser or to add an endpoint URL so that my application can send its POST request not to a web service owned by the browser manufacturer but to a web service that runs inside my intranet? As my application is run in an intranet without connection to the internet a customized browser wouldn't be a perfect solution but it would be possible.
And now for the 2nd part: If it is possible - are there ready-to-use push service libraries for PHP? So far all I've found are libraries that let an application send notifications like https://github.com/web-push-libs/web-push-php.
Is it possible to change the endpoint URL of a browser
No, currently it is not possible to change the browser push service.
And in any case you would also have to run an instance of the browser push service on your own servers (e.g. https://github.com/mozilla-services/autopush).
I think in this case you can just use any transport like web sockets, for instance and a notification API to show it to the user. Not sure if persistent connections will work within service worker context, but this should not be a problem if you're still customizing a browser.

Azure Easy API on Node.js 'No route registered for '/api/xxx'?

I'm having problems even running a simple Easy API method. I keep getting the response that says "No route registered for '/api/userInfo'".
I know that this location is correct because the I'm opening the App Service editor at https://XXXX/dev/wwwroot/api/userInfo.js
The file also has anonymous access, so there shouldn't be an authorization issue. I'm simply trying to hit the api method from a browser.
The code of this very simple method has been reduced to the following for debugging purposes
module.exports = {
"get":function(){
console.log('whooohooo');
}
};
Is there a setting I'm missing to enable the ability to call Easy API's? I've not been able to find any documentation that states that Easy APIs method must be explicitly enabled, nor can I find any settings related to enabling them.
Please note that I did not set up a Node.js project and deploy it to Azure. I am using an "out of the box" app service.
My end goal is to use an Easy API method go get an authenticated user's email and name, but my efforts have been reduced to confirming that I can call a method. Thanks in advance.
UPDATE:
I've created 3 different mobile App services with no luck and varying advantages.
App Service 1:
This Mobile Apps project is 10 months old and was created in the Azure portal. It has a routing line in the app.js file that suggest that the api route should be present, but doesn't work. I don't remember if i authorized the easy apis when i created it, but the fact that it has the following line suggests that I did
mobile.api.import('./api');
AppService 2:
This project was created in the MobileCenter using the Tables menu option for a Xamarin project. I then navigated to the Azure Portal and hooked up a SQL db to the table. I don't think I had the opt in to use Easy APIs, but the I was allowed to create an Easy API script, then edit it. Upon editing it, I realized that the project had no app.js file. Apparently web apps created via MobileCenter are created differently.
I picked this option because it allows you to use the "per-user" flag when setting up tables and doesn't require you to manually filter out data with a modification to the table's script. Apparently this is not an option if you don't set up an App Service via the MobileCenter??
App Service 3:
I created a brand new project within the portal and followed the the steps Aaron Chen laid out. I opted in, hooked up the table and modified the js file (I created a new one called 'testing'). I browsed to https://zzzzapitestzzzz1.scm.azurewebsites.net/api/testing
and got the dreaded no routes found error. Of course, the API method was created with anon access rights.
Basically, we can easily create an Easy API in the Azure portal.
Select your app service and click on Easy APIs in the MOBILE menu.
Enable Mobile extension for your app by clicking Need to configure Easy Tables/Easy APIs ...
Connect a database and then click Initialize App button.
After app initialized, you can add an API from Easy APIs blade.
Change the userInfo.js file to something like this:
Now, we can access the API with the endpoint http://<yourappname>.azurewebsites.net/api/userInfo.
For more info, please refer to this blog post.

Can I determine if app was installed via Facebook Ad?

Is there a way to determine if the currently running app was installed via Facebook ad?
I am currently calling [FBAppEvent activateApp] in my app delegate's applicationDidBecomeActive selector. I'm not using any other Facebook SDK features.
I would like to distinguish users that arrived via a Facebook ad. Is there any way on the phone to determine that an app installation came from a Facebook ad?
Here is the response I got from Facebook developer support on this issue.
Unfortunately this is not currently possible using the SDK. As per the docs, we only send information on when someone installs the app.
https://developers.facebook.com/docs/ads-for-apps/mobile-app-ads
"After installing the SDK, include the following code to be executed when your app is in the foreground. This will allow the app to ping back the install event to Facebook when the user opens up the app for the first time, and again in the future if there is a network error. Our client code will stop sending installs once it acquires a success code from the server, and our back-end will only count the install a single time if it receives multiple hits for the same device"
I hope this helps.
Thanks
Yes, there is. It isn't as easy as you would hope, but this is what you do.
Look in your logs on your server to see when someone's clicked through an ad
Find the IP address connected to that request I.E 8.8.8.8 (Google OpenDNS, if you're wondering).
look for the same IP address of someone who accesses the page after they've installed the app. If you find a match, your ad worked.
write a python script or have me write a python script to do this automatically.

Email Messaging module is not working on azure

I have deployed Orchard on azure and enable Email Messaging module. Enabling says it enables successfully and asks for email settings. I provided it the mail server setting. Strange thing is, User setting does not show me the settings which are dependent on email messaging module (Contact us email address and public site name) and does not show me ("Lost your password") link . Also I have built a module which sends email. This module is not sending email.
Same orchard package works fine and also email on my dev server with same mail server settngs(gmail smtp settings.) But email is not working on azure.
What am i Missing ?
thanx
Just FYI for anyone else who visits this Question, I just got this working from Azure using the gmail SMTP server without any third party add-ons. I simply added the following SMTP details:
Then used the contact form to send an email to myself. The first email gives me an alert to my gmail account:
Hi Simon,
Someone recently tried to use an application to sign in to your Google Account - XXX#gmail.com.
We prevented the sign-in attempt in case this was a hijacker trying to access your account. Please review the details of the sign-in attempt:
Monday, April 8, 2013 9:33:46 PM UTC
IP Address: 65.52.168.70
Location: United States
...blah blah blah
If this was you, and you are having trouble accessing your account, complete the troubleshooting steps listed at http://support.google.com/mail?p=client_login
Following the link give you the option to allow an application to login with your credentials. Just follow the link in step 3 and then you have 10 minutes to send another email from your orchard site. The next test message I received without issue.
Got it. Windows Azure itself does not allow sending email neither it allows to use SMTP. WE have to use third party email service like PostMark,SendGrid etc
http://blogs.msdn.com/b/publicsector/archive/2011/10/14/sending-and-receiving-email-in-windows-azure.aspx
So, I'm just curious how does WordPress, installed on Windows Azure (gallery), able to send emails?
http://coffee2code.com/wp-plugins/configure-smtp/
There are still too many different suggestions on the subject so i thought i should write what I've found useful. Here's what i did to get it to work:
My SMTP settings:
Sender address: myname#gmail.com
Hostname: smtp#gmail.com
Port: 587 (25 will also do)
SSL Communications: Checked
Credentials: My Gmail address and my password
These settings should work on your local environment just fine. But on the cloud you may need to do the following:
As your Azure VM may be at some arbitrary location, Gmail marks the login attempts as suspicious and blocks them. If this is the case, you should see a mail informing you about this suspicious activity in your inbox. Just follow the instructions there and mark the login as trusted. It will remain that way until somehow your IP on the cloud changes (e.g. deleting your deployment slot). VM relocation shouldn't be an issue since the IP still remains the same. You may have to do this separately for your staging and production slots.
Lastly, I enabled full trust for my web role as shown here:
http://blogs.msdn.com/b/windowsazure/archive/2009/03/18/hosting-roles-under-net-full-trust.aspx
I hope this helps others having this problem.
Cheers
No more third-party with GitLab 15.5 (October 2022):
Deliver emails using Microsoft Graph API with client credentials flow
If you’ve enabled security defaults in Azure AD,
legacy authentication protocols for SMTP are blocked.
You can now configure your GitLab instance to deliver emails using
Microsoft Graph API
with OAuth 2.0 client credentials flow.
See Epic, Documentation and Merge Request.
The gitlab.rb would include:
gitlab_rails['microsoft_graph_mailer_enabled'] = true
# The unique identifier for the user. To use Microsoft Graph on behalf of the user.
gitlab_rails['microsoft_graph_mailer_user_id'] = "YOUR_USER_ID"
# The directory tenant the application plans to operate against, in GUID or domain-name format.
gitlab_rails['microsoft_graph_mailer_tenant'] = "YOUR_TENANT_ID"
# The application ID that's assigned to your app. You can find this information in the portal where you registered your app.
gitlab_rails['microsoft_graph_mailer_client_id'] = "YOUR_CLIENT_ID"
# The client secret that you generated for your app in the app registration portal.
gitlab_rails['microsoft_graph_mailer_client_secret'] = "YOUR_CLIENT_SECRET_ID"
gitlab_rails['microsoft_graph_mailer_azure_ad_endpoint'] = "https://login.microsoftonline.com"
gitlab_rails['microsoft_graph_mailer_graph_endpoint'] = "https://graph.microsoft.com"

Resources