Testing POST methods for REST services

The PhoneGap Build “Access Origin” Problem

PhoneGap build makes it easy to create a PhoneGap application without needing to run PhoneGap locally on your own machine.  It does this by combining many of the configuration and plugin settings into a single configuration XML file.  The downside of this is that some of the options are more limited than they would be with standard PhoneGap.

One of these options is “Access Origin”.  This specifies which URLs are allowed to be accessed from within PhoneGap.  Other URLs are either opened in the phone’s standard browser or are denied altogether depending on the call type and access settings.  The problem is that currently iOS and Android builds handle things a little bit differently when it comes to access.    Apparently there is no combination that allows for some URLs to display in the PhoneGap app while others display using an external browser on both iOS and Android.

There are some workaround solutions to this:

  • Have all external links display in the same manner, either in the app or in a browser.  This is not ideal but is a simple solution
  • Create a different config.xml file for iOS and Android builds.  This eliminates the advantage of having a single build for all platforms.
  • Use a plugin such as ChildBrowser to open external links in a browser.  Requires additional configuration.

iOS Device Provisioning

There are a few steps to adding a new iOS device to a PhoneGapBuild project.

  1. Get the iOS device UDID. Here is a tutorial on getting the ID out of iTunes http://whatsmyudid.com/
  2. Add the Device to the devices list in the iOS Developer Portal at https://developer.apple.com/account/ios/device/deviceList.action
  3. Once the device is added, you need to edit the appropriate Provisioning Profile in the iOS Developer Portal make sure the new device is selected to be included in the profile.
  4. After saving the updated Provisioning Profile you will be able to download it.
  5. The new profile needs to be added to the Signing Key in PhoneGapBuild. See this post for instructions on adding a Signing Key in PhoneGapBuild

PhoneGapBuild iOS Signing Keys

Here are instructions to adding a Signing Key to PhoneGapBuild.

  1. Once signed into PhoneGapBuild navigate to the Edit Account section. This can be found by clicking the person icon in the top right of the site.
  2. Under Edit Account go to Signing Keys
  3. Click the Add a Key button under iOS ( Unfortunately there is no way to Edit an existing key, so if that is your intention I usually just delete and recreate the key)
  4. Give the Key a title
  5. Add your iOS p12 certificate and provisioning profile to the signing key (You can download these from the iOS developer center)
  6. Submit the key
  7. Once it is submitted, it will be added, but locked. Click the lock button and input the p12 certificate password (this was created when you generated the certificate)
  8. Navigate back to your PhoneGapBuild project. You should now see the Signing key in the dropdown next to the iOS build.
  9. Select the Signing key and re-build the project

Log Parser

Log parser is a powerful, versatile tool that provides universal query access to text-based data such as log files, XML files and CSV files, as well as key data sources on the Windows® operating system such as the Event Log, the Registry, the file system, and Active Directory®.

We primarily use it for that analysis of IIS logs but could use it for any thing including our log4net logs.

Downloads

Log Parser is a command line utility

http://www.microsoft.com/en-us/download/details.aspx?id=24659

To make it easier to work with, Microsoft developed a GUI for Log Parser.  It is called Log Parser Studio.

http://gallery.technet.microsoft.com/office/Log-Parser-Studio-cd458765

Basic Usage

Log Parser Studio needs access to the log files.  Since log files are produced and stored on the web server, you either need to install Log Parser Studio on the web server or download logs to your workstation.

  1. Open Log Parser Studio
  2. You will see a library of recipe queries.  Scroll down to see the IIS queries.
  3. Double click on the name of a query.  e.g. “IIS: HTTP Status Codes by Count”
  4. Click the folder open button (mustard color) in the toolbar
  5. Choose the folder where IIS logs are located
  6. Select files/folders
  7. Click the execute button (red exclamation) to run the query.
  8. Results will be displayed and can be exported

Advanced Usage

As you can see from the queries in the library the query language is SQL based.  Experiment with writing your own queries to get the information that you need just like you would in SQL.  As you would in SQL, just start by doing an exploratory query.

SELECT top 10 * FROM ‘[LOGFILEPATH]’

Then start experimenting.

Google for other examples.  Chances are somebody on the Internet has already written the query that you need.