DotNetOpenAuth and Quickbooks - asp.net

I'm need to develop a .NET 3.5 application that imports data from Quickbooks, and I decided to use DNOA to OAuthorize with them. I downloaded the latest available version (4.1.something), took a look around, then create a QuickBooksConsumer following the example of GoogleConsumer. However, there is a problem I cannot seem to solve.
The url of the QuickBooks REST services looks like this:
https://services.intuit.com/sb/{0}/v2/{1}
where:
{0} is the name of the object to get the records of (like, "invoice", or "payment");
{1} is the realmId, i.e. the id of the Company the data is required for
The problem is that I don't see how to do PrepareAuthorizedRequest with such variable urls. The function is not virtual, so I cannot override it in my QuickBooksConsumer.cs. I'm stuck.
Can you please show me the way how to do that?
Thanks in advance!

Authorizing requests to dynamically created URLs should be no problem at all. Just wrap any URL in a MessageReceivingEndpoint and send it through ConsumerBase.PrepareAuthorizedRequest and you're good to go.

Related

Registering a new identifier on developer.apple denotes that bundle identifier is "invalid"

So, I am trying to publish my Xamarin.Ios app to the app store (really test flight but I have to get an ipa) I'm following along the Microsoft documentation and trying to register a new identifier, however, when I insert my Bundle ID (gotten from info.plist) the web service marks it as "invalid identifier". I've been looking to see if I glanced over a pre-requisite in the documentation but I haven't noticed anything. Any help with this issue would be greatly appreciated. Thank you for your time.
It turns out that I had an underscore in my bundle id and that was the issue, ostensibly changing it to ascii code will fix the issue. However, I'm unsure of how to change it exactly, for instance, _ is 95 using ascii code but if I have blah_app and change it to blah95app that would allow me to register but I'm not sure if that is in the correct format.

Get project ID without using training module on custom vision?

I'm using the Custom Vision API and the sample I found out on github / docs included the training and creation of a project. However, I have done the training and creation part online (http://customvision.ai).
Now in order to predict the image, I need project ID.
endpoint.PredictImage(project.Id, testImage);
Where can I get this one from?
I am only interested in using the Prediction API without having to train from my code.
Your thoughts please.
The simplest way to get the project url from the website is to open the project in a browser and look at the URL; the project id is the GUID listed after /projects: customvision.ai/projects/<ProjectID>#/manage
Or you can call TrainingApi.GetProjects() to retrieve a list of ProjectModel objects, and get the project id you need by checking its properties (like Name or Description).

Open direct links to AX-objects or datasets from external application

Is there a way to open a specified document, eg "production order 123" or form, eg "purchase orders" in Ax2012 from an external application directly?
In detail, I'm looking for something similiar like AXPath, but this doesn't work with versions greater then 2009.
Is there any ( maybe included ) way to achieve this?
There is! It's using AX's drilldown functionality which uses AxHLink.exe to handle dynamics:// URLs, which are passed to the Classes\SysStartupCmd function. You could also create some custom code there if you wanted to launch the AX client executable directly.
My question I asked some while back should have a great deal of useful information in it here:
What handles dynamics:// URLs?
Some more can be found: http://technet.microsoft.com/en-us/library/aa834337.aspx
EDIT:
It sounds like you are confused or the posts weren't clear enough. I think you have 3 basic options.
Dynamics:// URLs are handled by AxHLink.exe and they only seem to handle drilldown, viewalert, and viewalertrule. So if you want to use Dynamics:// URLs, you will need to hi-jack those somehow. There is a pastbin from Jan in that other stack post.
Create a custom URI handler and event poller (lot of work) see http://axcoder.blogspot.dk/2010/10/how-to-open-form-in-running-ax-from.html
Extend SysStartupCmd and then instead of using Dynamics:// URLs, just call Ax32.exe -startupCmd directly and a parameter can be passed to your custom class.

How to build .NET web scraper for news articles about people

I am looking to create a simple webservice to crawl webpages on specific websites and look for a person's name. Anybody know if there are any examples out there of this, or can anyone help me with the start of this?
Edit: I should mention I want to do this with Visual Studio C#. I will only be looking at English news sites that I specify.
Here is a simple function that returns true if a Web page contains a person's name:
string response;
using (System.Net.WebClient wc = new System.Net.WebClient())
{
response = wc.DownloadString(url);
}
return reponse.Contains("John Doe");
For finding the links within the page, check out this question:Parse HTML links using C#
You can collect distinct Urls throughout the site and run the code above for each Url you find.
Also, type this into Google to see what they find. site:www.somesite.com "John Doe"
Using c# your best option for a crawler and parser (the two parts to your solution) would be to use functionality exposed by the HtmlAgility Pack, which can be found on CodePlex.
Refer to this answer for an example usage scenario: How to use HTML Agility pack

SqlProfileProvider - can you use Profile.GetProfile() in a project?

I am attempting to use the SqlProfileProvider in an application and can't seem to use it the way I want to. I would like to be able to simply call up a profile like this:
Profile p = Profile.GetProfile("naspinski");
p.Organization = "new_org";
but I can't seem to find the correct way to use the GetProfile() that I seem to see scattered around the net. Is there a way to grab, read and modify profiles?
I am using it in MVC 3 and will not be actually logging in as the specific user, this will be pulling users from the db that are specified. Thank you.
To retrieve the profile:
var profile = ProfileBase.Create(HttpContext.Profile.UserName, true);
And here's the MSDN documentation. And a nice blog post about custom profiles.

Resources