I am trying to learn the development process for Service Fabric
by using one of the popular samples from Microsoft, called WordCount.
I do not have Azure account yet, so I installed the Local Cluster
on my Windows 10. I went through the instructions on Microsoft
website and most of it works. I can see the Cluster Manager with:
http://localhost:19080/Explorer
where I can see the application:
fabric:/WordCount WordCount 1.0.0 OK Ready
From inside the Powershell I can connect to the Local Cluster
and run the cmdlets with output as expected
Get-ServiceFabricApplication
Get-ServiceFabricService -ApplicationName 'fabric:/WordCount'
Get-ServiceFabricPartition 'fabric:/WordCount/WordCountService'
The problem is when I run
http://localhost:8081/wordcount/index.html
the browser does not display anything. It is supposed to display
the counts of words generated by client-side JavaScript
and processed by ASP.NET Web API. My browser has JavaScript enabled.
I do not know yet enough about the code in the sample but I have its solution with 4 projects loaded in VS2017. I just want to make it work ASAP.
Below I attach a part of console output in my browser (FireFox). Apparently, the JS script is getting
[HTTP/1.1 404 Not Found 0ms]
in response to all requests.
POST
XHR
http://localhost:8081//wordcount/index.html/api/AddWord/WYVyl [HTTP/1.1 404 Not Found 0ms]
XML Parsing Error: no root element found
Location: http://localhost:8081//wordcount/index.html/api/AddWord/WYVyl
Line Number 1, Column 1: WYVyl:1:1
POST
XHR
http://localhost:8081//wordcount/index.html/api/AddWord/YcIMv [HTTP/1.1 404 Not Found 0ms]
XML Parsing Error: no root element found
Location: http://localhost:8081//wordcount/index.html/api/AddWord/YcIMv
Line Number 1, Column 1: YcIMv:1:1
GET
XHR
http://localhost:8081//wordcount/index.html/api/Count [HTTP/1.1 404 Not Found 0ms]
XML Parsing Error: no root element found
Location: http://localhost:8081//wordcount/index.html /api/Count?c=0.7465426272903215
Line Number 1, Column 1: Count:1:1
The problem is that you're trying to open up "http://localhost:8081/wordcount/index.html" while you should use "http://localhost:8081/wordcount/". Otherwise the javascript code builds incorrect url to access the services.
Related
I'm using a node soap client to connect to the Bing Ads API and I log the URL within the sendRequest() method:
https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v13/CustomerManagementService.svc?wsdl
Which is correct according to the Bing docs here.
But when I get the error output (after the code hangs) it's a different URL. The entire error is:
Error: Invalid WSDL URL: https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v13/CustomerManagementService.svc?xsd=xsd1
Side by side of the two URLs:
https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v13/CustomerManagementService.svc?wsdl
https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v13/CustomerManagementService.svc?xsd=xsd1
It looks like the only difference is that wsdl in the correct URL is being replaced by xsd=xsd1.
Also, I know very little about SOAP APIs so I'm just trying to figure out what is happening.
Why is the URL being altered?
I am new to ADF. I created an http linked service and it tested successfully (https://rebrickable.com/downloads/). On the http dataset properties page the same url address is in the Base URL. I then put just the file name that exists on that page (themes.csv.gz) in the Relative URL. When I click next to the File format settings page the Preview pane says:
Failed to read data from http server. Check the error from http
server:The remote server returned an error: (404) Not Found. The
remote server returned an error: (404) Not Found. . Activity ID:
0ca9f9c7-438d-461a-81c1-f81bacace4ca
What am I doing wrong please?
I also tried to create a new linked service and point it to my desktop files. I selected'File', left it at AutoresolveIntegrationruntime, put the path in Host. But don't know what do to with User/password. Please help
I hit the above mentioned end point in by browser : https://rebrickable.com/downloads/themes.csv.gz
Looks like the file is not existent at the mentioned location.
I did a quick scan of the page https://rebrickable.com/downloads
Encountered the below file :
Saw the file hyperlinked to this url (This is different from what you're attempting to in the ADF)
https://cdn.rebrickable.com/media/downloads/themes.csv.gz
I was able to download the file by using the above.
Would suggest you to try the above endpoint.
Update your url to https://cdn.rebrickable.com/media/downloads/ in https connection source
I have an MS Teams adapter written using the botframeworks sdk v4 for node js which works perfectly for normal conversations. But when I try to do a task/fetch, it returns an error message "Unable to reach app. Please try again." on the task module popup
I can see from the inspector that it returns 502 response for the request to invoke the task module
The task module returns a simple adaptive card and I can see that I get a callback on my handleTeamsTaskModuleFetch function from the logs
The adapter runs on a docker container with an nginx proxy and the nginx logs shows that, it returns a 200 response whenever I click on the task module launch button
I have a similar setup in my dev and taskmodule works perfect there
Any help is highly appreciated
Update
I have tried hardcoding the adaptive card. That doesnt help either
Eventually it was found that there was a problem with one of the csp headers and microsoft was not happy about it.
I removed the CSP headers and the taskmodule started working
Thanks to #gousia-msft for your help in debugging the issue
I am banging my head trying to use Flickr API...
My goal is to be able to upload images and create albums in my Flickr account from my website...
I tried the phpFlickr library but apparently it needs updates for getting authenticated tokens...It keeps giving me "Invalid auth token".
I did some reading on how to get tokens and using DPZFlickr managed to get oauth_token & oauth_verifier but failed to exchange that with an access token...It also failed in uploading any photo to my account using the included upload.php example (Giving me an "empty" error!).
After digging in DBZ flickr.php code, I managed to get this error when trying to upload to Flickr: "oauth_problem=signature_invalid&"
So I began to search how to create a valid signature to eventually get a valid access token...and concluded that it is quite some work to be done here if I am going to build everything from scratch.
So my question is: Are there any updated php libraries that I can use to successfully create albums and upload photos to my Flickr account? Or should I go ahead and try building one?
OK..I finally got it to work with the DPZ library.
For future reference anybody facing the same problem as I had:
I managed to create an album using DPZFlickr by changing the method in auth.php to flickr.photosets.create....which indicated that the library correctly generates an access token with write permission..
However, the upload example kept giving me the "Invalid signature" error....
I checked the code. Flickr.php correctly unsets the photo parameter before signing the request then adds it back and submits the request which is exactly as indicated in: www.flickr.com/services/api/upload.api.html
I found a discussion in https://www.flickr.com/groups/51035612836#N01/discuss/72157650261711318/ that cleared out that the error was not actually a signature problem, but rather the 'photo' parameter that is being sent is the problem. It's just that Flickr doesn't know what to do with the photo parameter so it sends the signature error.
So what' wrong with the photo parameter?
Flickr API requires that the image has to be sent in binary form...The DBZ library, Flickr.php script line 677, does the hard work for us using the cURL function in php (http://au.php.net/manual/en/function.curl-setopt.php).
It sends the $parameters (which includes the uploaded photo) to the post field of the http request which should do the upload in binary format for us.
However, a brilliant comment I found in CURL PHP send image
states that:
"CURLOPT_SAFE_UPLOAD defaulted to true in 5.6.0... so you will need to add curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); before setting CURLOPT_POSTFIELDS"
Checking the manual: http://au.php.net/manual/en/function.curl-setopt.php
it says:
"Added in PHP 5.5.0 with FALSE as the default value. PHP 5.6.0 changes the default value to TRUE."
So if your php version is 5.5.0 the library will work just fine whilst if using version PHP 5.6.0 you need to add a line before 677 in Flickr.php to change the CURLOPT_SAFE_UPLOAD to false (that's why the library works with some and others not).
To solve the issue...Just add this line before line 677 in Flickr.php:
curl_setopt($curl, CURLOPT_SAFE_UPLOAD, false);
That's it. (-:
I've built the sample app from here: https://developer.nest.com/documentation/cloud/control/
I've created a Client configuration on the developer site with the callback url http://localhost:8080.
The app loads and brings you to the Nest login screen. After entering details it should redirect back but instead the URL https://home.nest.com/session fails with a 400 Bad Request and the response:
{"error":"invalid_request","error_description":"missing user credentials"}
Has anyone got this sample working lately? I believe it's failing in the server.js file at this line (but I'm no Node expert unfortunately):
app.get('/auth/nest', passport.authenticate('nest'));
I've replaced the firebase.js file with the version from the Nest site. Could this be a bug in a recent version of Express or the Nest Passport library?
Tried on OSX, Linux and Windows and getting the same issue.
Thanks!
The OAuth Redirect URI in your client for this example should be http://localhost:8080/auth/nest/callback and be sure that your permissions are set for Thermostat read/write.