<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:betag="http://dotnetblogengine.net/schemas/tags">
  <channel>
    <title>Nik's Technology Blog</title>
    <description>Travels through programming, networks, and computers</description>
    <link>http://www.nikmakris.com/blog/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 3.2.0.3</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://www.nikmakris.com/blog/opml.axd</blogChannel:blogRoll>
    <dc:creator>Nik Makris</dc:creator>
    <dc:title>Nik's Technology Blog</dc:title>
    <geo:lat>0.000000</geo:lat>
    <geo:long>0.000000</geo:long>
    <item>
      <title>Anonymizing user data from an aspnet Membership database</title>
      <description>&lt;p&gt;Use this T_SQL script to anonymize data from ASP.NET's Membership database.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="brush:sql;auto-links:false;toolbar:false" contenteditable="false"&gt;declare @email varchar(255)
set @email = 'email_to_delete@gmail.com'

update aspnet_profile 
set PropertyNames = '', PropertyValuesString = '' 
where UserId = (
SELECT UserId
FROM aspnet_Membership 
where Email = @email
)

update aspnet_Membership 
set Email = 'deleted@deleted.com', LoweredEmail = 'deleted@deleted.com', IsApproved = 0, PasswordQuestion = 'deleted', PasswordAnswer = 'deleted', [Password] = 'deleted'
where UserId = (
SELECT UserId
FROM aspnet_Membership 
where Email = @email
)&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <link>http://www.nikmakris.com/blog/post/anonymizing-user-data-from-an-aspnet-membership-database.aspx</link>
      <comments>http://www.nikmakris.com/blog/post/anonymizing-user-data-from-an-aspnet-membership-database.aspx#comment</comments>
      <guid>http://www.nikmakris.com/blog/post.aspx?id=fc1e9120-be47-4830-a3aa-4fa4fa815425</guid>
      <pubDate>Mon, 22 Jun 2020 19:45:00 +0100</pubDate>
      <category>Blog</category>
      <category>Databases</category>
      <category>Software Development</category>
      <dc:publisher>nik.makris</dc:publisher>
      <pingback:server>http://www.nikmakris.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.nikmakris.com/blog/post.aspx?id=fc1e9120-be47-4830-a3aa-4fa4fa815425</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.nikmakris.com/blog/trackback.axd?id=fc1e9120-be47-4830-a3aa-4fa4fa815425</trackback:ping>
      <wfw:comment>http://www.nikmakris.com/blog/post/anonymizing-user-data-from-an-aspnet-membership-database.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.nikmakris.com/blog/syndication.axd?post=fc1e9120-be47-4830-a3aa-4fa4fa815425</wfw:commentRss>
    </item>
    <item>
      <title>Royal Mail API - Migrating to Pro Shipping API from DMO API</title>
      <description>&lt;p&gt;After our Royal Mail API was migrated to the new Pro Shipper API platform in June 2018 our integration stopped working, we were getting the following response back from Royal Mail:&amp;nbsp;&lt;span style="color: #008000;"&gt;"The remote server returned an unexpected response: (405) Method Not Allowed."&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;We are using the SOAP version of the API with a .NET client originally based on this &lt;a href="https://github.com/povilaspanavas/RoyalMailShippingApiV2" target="_blank"&gt;example integration&lt;/a&gt; by povilaspanavas.&lt;/p&gt;
&lt;p&gt;Trying to find any details on what we needed to do to make this upgrade continue to work was difficult as we were under the impression no changes would need to be made from our end. This is the email response we got back from Royal Mail.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #0000ff;"&gt;We are sorry to hear that your API connection has connection issues after migration to Royal Mail Pro Shipper.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #0000ff;"&gt;If you are receiving blank API responses or &amp;ldquo;Authorization Failure&amp;rdquo; responses from the API, your connection issues can be resolved quickly by following the instructions in the attached document and setting up your API Password in Royal Mail Pro Shipper. &lt;strong&gt;Until you do this, your API calls will not work.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #0000ff;"&gt;Please note:-&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="color: #0000ff;"&gt;The confirmation email for migration would have been sent to your DMO email address, your API Developer Portal Address and if you completed the migration web form, the email address listed as the contact email address. If you did not receive the email, please contact &lt;a style="color: #0000ff;" href="mailto:shippingsupport@royalmail.com"&gt;shippingsupport@royalmail.com&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #0000ff;"&gt;Your Royal Mail Pro Shipper Login will be the same login username as your DMO email address.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #0000ff;"&gt;&lt;strong&gt;If you changed your API Password in Pro Shipper, you need to advise your IT Developer to update the password in your API calls.&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="color: #0000ff;"&gt;Some important notes about the API migration are:-&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="color: #0000ff;"&gt;If you have coded the API connection in .Net, you will need to update to SOAP 1.2 from SOAP 1.1&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #0000ff;"&gt;The API responses now have an Upper Case element name for SOAP-ENV instead of lower case&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #0000ff;"&gt;The API responses no longer return warnings in the integration footer&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #0000ff;"&gt;The 2D Item ID now returns a hex value instead of a decimal value.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #0000ff;"&gt;The Channel ID in the 2D barcode has changed. If you are generating the 21 Character UID from the 2D barcode in your system you will need to update your system not to convert the 2D Item ID to Hex and you will need to update the Channel ID.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We made sure the API password was set-up correctly in Pro Shipper but that didn't fix the problem.&lt;/p&gt;
&lt;p&gt;After some trial and error I managed to fix our integration by adding this HTTP header to the CreateShipment method.&lt;/p&gt;
&lt;pre class="truncatedPre cs truncate hljs"&gt;&lt;code&gt;httpRequestProperty.Headers.Add(@"Accept", "application/soap+xml");&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And removing all code trying to read warnings in the integration footer, as these are no longer sent back.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <link>http://www.nikmakris.com/blog/post/royal-mail-api-migrating-to-pro-shipping-api-from-dmo-api.aspx</link>
      <comments>http://www.nikmakris.com/blog/post/royal-mail-api-migrating-to-pro-shipping-api-from-dmo-api.aspx#comment</comments>
      <guid>http://www.nikmakris.com/blog/post.aspx?id=a30273b3-86ee-4116-b7e9-8ebc4fbbdb39</guid>
      <pubDate>Wed, 27 Jun 2018 11:29:00 +0100</pubDate>
      <dc:publisher>nik.makris</dc:publisher>
      <pingback:server>http://www.nikmakris.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.nikmakris.com/blog/post.aspx?id=a30273b3-86ee-4116-b7e9-8ebc4fbbdb39</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.nikmakris.com/blog/trackback.axd?id=a30273b3-86ee-4116-b7e9-8ebc4fbbdb39</trackback:ping>
      <wfw:comment>http://www.nikmakris.com/blog/post/royal-mail-api-migrating-to-pro-shipping-api-from-dmo-api.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.nikmakris.com/blog/syndication.axd?post=a30273b3-86ee-4116-b7e9-8ebc4fbbdb39</wfw:commentRss>
    </item>
    <item>
      <title>Upgrading an MVC Project to Bootstrap as a Side Project</title>
      <description>&lt;p&gt;We have an existing ASP.NET MVC project which has grown to the point where making the switch to use the Bootstrap framework required a substantial amount of work to the Views. Unfortunately this isn't high priority so we couldn't afford to do this in one go, instead we had to find a solution which would enable us to deploy the solution into production using the old Views and Layouts to introduce new functionality to the solution mid-way through the Bootstrap conversion.&lt;/p&gt;
&lt;p&gt;To overcome this problem and allow us to upgrade to Bootstrap as a side project we needed a clever solution to effectively allow us to switch from Bootstrap to the old Views and Layout quickly and easily, and then back again.&lt;/p&gt;
&lt;p&gt;This was our solution to the problem:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;We created a Bootstrap MVC _Layout and added it to the solution.&lt;/li&gt;
&lt;li&gt;We created an ActionFilterAttribute class called UseBootstrapLayout which we used to decorate the Actions to denote which Layout the Action method should use to render the View.&lt;/li&gt;
&lt;li&gt;We copied each View we were going to upgrade to Bootstrap and named it the same but appended a 2 at the end of the filename.&lt;/li&gt;
&lt;li&gt;In _ViewStart.chtml we added to code (below) to check if the View ended with a 2 and which allowed us to switch to the Bootstrap Layout if it did.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If we needed to deploy the application before the Bootstrap update was complete we simply changed to _ViewStart.chtml code to use the old _Layout. All the rest of the code changes and new Views could stay the same.&lt;/p&gt;
&lt;div class="well"&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;summary&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// Method to change a view name used by an action method.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// We are using this to enable us to re-skin the system&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;/summary&amp;gt;&lt;/p&gt;
public class UseBootstrapLayout : ActionFilterAttribute&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override void OnActionExecuted(ActionExecutedContext filterContext)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filterContext.RouteData.Values["action"] = filterContext.RouteData.Values["action"] + "2";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;
&lt;div class="well"&gt;
&lt;p&gt;@{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // _ViewStart.chtml&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var view = HttpContext.Current.Request.RequestContext.RouteData.Values["action"].ToString();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string layout = "";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (view.EndsWith("2"))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layout = "~/Views/Shared/NewBootstrapLayout.cshtml";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layout = "~/Views/Shared/_Layout.cshtml";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Layout = layout;&lt;br /&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;div class="well"&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [UseBootstrapLayout]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [HttpGet]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public ActionResult Index()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return this.View();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;</description>
      <link>http://www.nikmakris.com/blog/post/upgrading-an-mvc-project-to-bootstrap-as-a-side-project.aspx</link>
      <comments>http://www.nikmakris.com/blog/post/upgrading-an-mvc-project-to-bootstrap-as-a-side-project.aspx#comment</comments>
      <guid>http://www.nikmakris.com/blog/post.aspx?id=6b65c8ae-2033-4725-830b-8dac2cb1ad8b</guid>
      <pubDate>Wed, 2 Nov 2016 15:27:00 +0000</pubDate>
      <category>Software Development</category>
      <category>Web Development</category>
      <betag:tag>asp.net mvc</betag:tag>
      <dc:publisher>nik.makris</dc:publisher>
      <pingback:server>http://www.nikmakris.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.nikmakris.com/blog/post.aspx?id=6b65c8ae-2033-4725-830b-8dac2cb1ad8b</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.nikmakris.com/blog/trackback.axd?id=6b65c8ae-2033-4725-830b-8dac2cb1ad8b</trackback:ping>
      <wfw:comment>http://www.nikmakris.com/blog/post/upgrading-an-mvc-project-to-bootstrap-as-a-side-project.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.nikmakris.com/blog/syndication.axd?post=6b65c8ae-2033-4725-830b-8dac2cb1ad8b</wfw:commentRss>
    </item>
  </channel>
</rss>