Can the netduino board send and receive directly to and from my appharbor app? - appharbor

Hi i would like to send data from my netduino board directly to my app that is hosted on appharbor, I couldn't find any examples. I may be asking the question wrongly, if so thanks for you patience.
:)

This post has resources on how to send http reqeusts from .NET Micro Framework apps. If you send JSON from the board, you can receive in an ASP.NET MVC 3 action on AppHarbor. There's an example on this question: Receive JSON from external server, parse it and save it to local database with MVC2

http://netduinohacking.blogspot.com/ has a good example.

Related

How to work in Laravel app with external api?

in my Laravel 5.7/mysql app I need to make external api to read some data from external
app with get request and to write some data to my db with post request.
Which tools/scripts are there for this and how to make these requests safe?
MODIFIED :
Thanks for feedbacks, but looks like I badly put my question
The external app(I do not know what is it written with) need to read data from my app
and write data to my Laravel 5 app.
And how have I to test these requests while on development locally ?
Looks like I have to use Guzzle as in provided link?
Which steps have I to take for safety on my side?
Thanks!
These three libraries are popular for your use-case:
Guzzle
Curl
zttp
If the database is local you can use Eloquent, If not, remote connection to that database may help. otherwise, if you only have API access you should consume eighter of above libraries or any alternative options to make an HTTP request your application might require.
Security-wise, as long as you are only making a request to a remote server, the Suggested way is to store any key or secret string related to authorizing your request (if applicable) in your .env to prevent it from committed to your version control systems. Needless to say to always handle any possible HTTP error your remote API might throw in order to prevent any unwanted error on your application side.
And as Abir Adak mentioned in the comment check this thread for further details.
Updated Answer: On the case of MODIFIED part, generally you have 3 popular options,
REST API
This blog post is a detailed walkthrough written for Laravel
This one from Stack Overflow can help you with designing you API
This last one can help you to develop a widely accepted API response and endpoints by following its specifications.
GraphQL
Can save some time for developing your API, but I suggest to make sure that the consumers of your API are happy to use this option.
GraphQ
Laravel Package for GraphQL
If using Laravel isn't a must, and you are using PostgreSQL, you might want to look at Hasura as well.
SOAP
Have little knowledge on this option for Laravel, just know folks coding using C# and .net are happier to expose their API with this protocol. read more about it on WikiPedia
Postman is a great tool for testing your API or any other API.

SignalR Not Working with Windows Auth

I've created a test MVC5 application to run the simple SignalR chat client shown here and everything worked as the tutorial described.
http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr-and-mvc
I've then created another project where I enable Windows Authentication and my messages are not being received by the chat clients. However, my message requests are hitting the "ChatHub" Send method but my chat clients are not receiving the messages. Everything is identical to the original tutorial except for adding Windows Authentication. Any ideas what could be my problem? Thanks in advance.
jquery.signalR-2.1.2.min.js
Appears to be a user error. I jumped between the original SignalR tutorial and SignalR with MVC5 tutorial and ran into a discrepancy. Original SignalR tutorial had chat.client.addNewMessageToPage" and the SignalR with MVC5 tutorial "chat.client.broadcastMessage" and I must have botched the copy and paste job between projects and tutorials. Feeling a little sheepish at the moment.

Using own domain model/entity on client with wcf data service (uses web api/odata/entity framework) as service reference

Here's my situation, I'm trying to create a WPF application that connects to my own web odata service (uses web api and entity framework). I have my own set of domain models/entities in the server side that the web api and entity framework works with. When, I add the web odata service reference in the WPF client side, it can't recognize my own domain models/entities and it looks like it creates its own set of it. Is what I'm trying to do even possible or am I just missing something?
Regards,
Raymond
Drive-by answer (unchecked): I remember reading that it wasn't possible at least a few weeks back. You might want to search the Uservoice site and the official forums for current status, or wait for a better answer here.
It looks like this problem is currently a feature suggestion for WCF Data Services (thanks to tne's uservoice link). The direct link to the request is https://data.uservoice.com/forums/72027-wcf-data-services-feature-suggestions/suggestions/3220086-allow-re-using-entities-from-another-dll-on-the-cl.

How to receive sms on asp.net using nexmo service

I need some guidance on what steps I should follow to receive sms messages using service from www.nexmo.com.
I am not familiar with asp.net but I am very familiar with C# on windows, so please if you can provide a few steps to get me going then I can pick it up from there. Right now I have an account at www.godaddy.com, so I am hoping I can write the code to place it there. I don't really need much details on how to use nexmo service, I mainly need to know what I should do on my web site to receive sms from nexmo.
Incoming SMS's are simply HTTP requests to your 'page'. Nexmo send's the SMS and related data just like a HTML from submits data to a URL using a GET (query string) or POST (form encoded),
So all you have to do is point Nexmo to the URL you want to use, and check the incoming request for the data. Here's the documentation for incoming messages.
Here's a community authored C# library that might be be helpful.
(Disclaimer: I do a bit of developer evangelism for Nexmo.)

Using MvcMailer in non-MVC project

I have a windows service that is supposed to send e-mails periodically.
Next to the windows service project there is an MVC 3 project that is sending e-mails with MvcMailer (beautifully).
I want to use the same engine to send e-mails for the windows service.
How should I do it?
Import the MVC binaries and create one controller and new views for this purpose? Will it work?
Saving it in the database and requesting my web project to send the e-mail might not be the best solution because the information is the result of a query and is too big to be sent in the request.
The only other option I see is to simply request the web project to do all the work but this way it wouldn't be beneficial to place the windows service in another service to save the site application resources.
How would you do it?
As an alternative to MVC Mail, ActionMailer.NET can now be used stand-alone outside of MVC.
The details are covered here
http://geeksharp.com/2011/07/06/actionmailer-0-6-released/
I would argue that calling a mvc mailer from the service might be an overkill. If the mvc project is supposed to expose sending the email API for all of your other solutions, then building a REST api might make sense. However, if you just want to bring the functionality of the action method to the windows service, then i would choose an in-process functional component. If you can refactor the logic of the mvcmailer action method into another assembly why not just do that and then include that assemlby as a depedency in your windows service solution.
If you can provide the over all purpose of the mailer and how it's used in the web scenario, it may help us to provide a better architecture.
Why do you think the query to send to mvcmailer us too large? If you have the mailer MVC project already working and exposed via a restful URL, that becomes your email service and simply call it as a web request from your service.
You can get around size constraints in your request That shouldnt be an issue.

Resources