Fingolricks
Fingolricks

Reputation: 1212

Microsoft Azure Notifications Error: 404 No service is hosted at the specified address

Good morning community,

I have a Microsoft Azure service that I'm trying to use to send notifications to android mobile devices. I followed the steps in the tutorial provided by Microsoft Azure guys and when I run the following code to send a test notification,

$ message = '{"data": {"msg": "Hello from PHP!"}}'; 
$ notification = new Notification ("gcm", $ message); 
$ hub-> SendNotification ($ notification, ""); 

I get this error message.

Error sending notificaiton: 404 
msg: 404 No service is hosted at the specified address .. 
TrackingID: e147f89a-8bad-4f73-a4c4-8f4194a728ed_G18, 
TimeStamp: 10/24/2014 2:16:15 PM 

Anyone have idea why this happens? And do you know how to solve it?.

I have the impression that maybe is a bug in my code or I put something wrong on the server, because as it is a REST service, it should work for everyone.

IDK if you guys need my Connection String or the App Name or something T_T

As suggested by @efimovandr, here is the HTTP Call Request

GET http://mer-extra.cloudapp.net/matches/mandarPush.php HTTP/1.1
Host: mer-extra.cloudapp.net
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,es;q=0.6,pt;q=0.4,th;q=0.2,gl;q=0.2
Cookie: CAKEPHP=t3foani8l7sineodcel5svplq5

And the response is:

HTTP/1.1 200 OK
Date: Tue, 28 Oct 2014 14:33:02 GMT
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.3.10-1ubuntu3.13
Vary: Accept-Encoding
Content-Length: 2230
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8

Hope this help. Thx!

Upvotes: 2

Views: 2018

Answers (1)

allencoded
allencoded

Reputation: 7275

Your problem may have been the same as mine:

Azure push notification rest no service is hosted at the specified address

Important thing is the hub name is not the same as the namespace name unlike their current tutorial says it is. (Microsoft told me they would edit and update this in their docs).

Second make sure you use the right key (DefaultFullSharedAccessSignature). This is another error they had in their docs.

Upvotes: 2

Related Questions