<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shawson&#039;s Code Blog &#187; Web Services</title>
	<atom:link href="http://codeblog.shawson.co.uk/category/web-services/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeblog.shawson.co.uk</link>
	<description>development notes for my failing memory</description>
	<lastBuildDate>Wed, 01 Feb 2012 11:00:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WCF Services with both JSON and SOAP endpoints</title>
		<link>http://codeblog.shawson.co.uk/wcf-services-with-json-and-soap-endpoints/</link>
		<comments>http://codeblog.shawson.co.uk/wcf-services-with-json-and-soap-endpoints/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 13:14:26 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://codeblog.shawson.co.uk/?p=1195</guid>
		<description><![CDATA[A quick example of how to set this up in the web.config. Services, in this example, can be accessed using JSON via localhost/Services/MyService.svc/HelloWorld or.. using SOAP on localhost/Services/MyService.svc/soap/HelloWorld &#60;system.serviceModel&#62; &#60;serviceHostingEnvironment multipleSiteBindingsEnabled=&#34;true&#34; aspNetCompatibilityEnabled=&#34;true&#34; /&#62; &#60;services&#62; &#60;service behaviorConfiguration=&#34;WebServiceBehavior&#34; name=&#34;Demo.Web.Services.MyService&#34;&#62; &#60;endpoint address=&#34;&#34; binding=&#34;webHttpBinding&#34; contract=&#34;Demo.Web.Services.IMyService&#34; behaviorConfiguration=&#34;jsonBehavior&#34; /&#62; &#60;endpoint address=&#34;soap&#34; binding=&#34;basicHttpBinding&#34; contract=&#34;Demo.Web.Services.IMyService&#34;/&#62; &#60;/service&#62; &#60;/services&#62; &#60;behaviors&#62; &#60;endpointBehaviors&#62; &#60;behavior name=&#34;jsonBehavior&#34;&#62; &#60;webHttp defaultOutgoingResponseFormat=&#34;Json&#34; [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/getting-started-with-wcf-and-rest-web-services/' rel='bookmark' title='Getting started with WCF and REST web services'>Getting started with WCF and REST web services</a></li>
<li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
<li><a href='http://codeblog.shawson.co.uk/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>A quick example of how to set this up in the web.config.</p>
<p>Services, in this example, can be accessed </p>
<ul>
<li>using JSON via localhost/Services/MyService.svc/HelloWorld or..</li>
<li>using SOAP on localhost/Services/MyService.svc/soap/HelloWorld </li>
</ul>
<pre class="brush: xml">
  &lt;system.serviceModel&gt;
    &lt;serviceHostingEnvironment multipleSiteBindingsEnabled=&quot;true&quot; aspNetCompatibilityEnabled=&quot;true&quot; /&gt;

    &lt;services&gt;
      &lt;service behaviorConfiguration=&quot;WebServiceBehavior&quot; name=&quot;Demo.Web.Services.MyService&quot;&gt;
        &lt;endpoint address=&quot;&quot; binding=&quot;webHttpBinding&quot; contract=&quot;Demo.Web.Services.IMyService&quot; behaviorConfiguration=&quot;jsonBehavior&quot; /&gt;
        &lt;endpoint address=&quot;soap&quot; binding=&quot;basicHttpBinding&quot; contract=&quot;Demo.Web.Services.IMyService&quot;/&gt;
      &lt;/service&gt;
    &lt;/services&gt;

    &lt;behaviors&gt;
      &lt;endpointBehaviors&gt;
        &lt;behavior name=&quot;jsonBehavior&quot;&gt;
          &lt;webHttp defaultOutgoingResponseFormat=&quot;Json&quot; /&gt;
        &lt;/behavior&gt;
      &lt;/endpointBehaviors&gt;

      &lt;serviceBehaviors&gt;
        &lt;behavior name=&quot;WebServiceBehavior&quot;&gt;
          &lt;serviceMetadata httpGetEnabled=&quot;true&quot; /&gt;
          &lt;serviceDebug includeExceptionDetailInFaults=&quot;true&quot; /&gt;
        &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;

    &lt;bindings&gt;
      &lt;webHttpBinding&gt;
        &lt;binding crossDomainScriptAccessEnabled=&quot;false&quot; name=&quot;httpBinding&quot; /&gt;
      &lt;/webHttpBinding&gt;
    &lt;/bindings&gt;

  &lt;/system.serviceModel&gt;
</pre>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/getting-started-with-wcf-and-rest-web-services/' rel='bookmark' title='Getting started with WCF and REST web services'>Getting started with WCF and REST web services</a></li>
<li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
<li><a href='http://codeblog.shawson.co.uk/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/wcf-services-with-json-and-soap-endpoints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter OAuth Registration</title>
		<link>http://codeblog.shawson.co.uk/twitter-oauth-registration/</link>
		<comments>http://codeblog.shawson.co.uk/twitter-oauth-registration/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 23:17:08 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=886</guid>
		<description><![CDATA[Any app&#8217;s you create now which need to post to twitter programmatically, will need to do so using oAuth, for which you will need to register your app with twitter- this can be done @ http://dev.twitter.com/apps/new Once registered you will be taken to a page with your consumer keys (a key value and a secret [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Any app&#8217;s you create now which need to post to twitter programmatically, will need to do so using oAuth, for which you will need to register your app with twitter- this can be done @ <a href="http://dev.twitter.com/apps/new">http://dev.twitter.com/apps/new</a> Once registered you will be taken to a page with your consumer keys (a key value and a secret value)- to get your access token, click the button on the right of that page (a token and a secret) and you should now have all 4 values you need to perform oAuth authentication prior to interacting with twitter.</p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/twitter-oauth-registration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSDeploy Setup Guide &amp; How to Call Server Side Method Using jQuery/Ajax</title>
		<link>http://codeblog.shawson.co.uk/msdeploy-setup-and-calling-server-side-method-using-jqueryajax-karans-blog/</link>
		<comments>http://codeblog.shawson.co.uk/msdeploy-setup-and-calling-server-side-method-using-jqueryajax-karans-blog/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 08:09:05 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=782</guid>
		<description><![CDATA[Couple of interesting items popped up in the RRS feed&#8217;s this morning. Automating Deployment with Microsoft Web Deploy &#8211; ScottGu&#8217;s Blog. Calling Server Side Method Using jQuery/Ajax &#8211; Karan&#8217;s Blog. Related posts:AxCMS.net v9 Release&#8211; any good? JQuery Accordion Control links not working ASP.net update panel&#8217;s and jQuery


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/axcms-net-v9-release-any-good/' rel='bookmark' title='AxCMS.net v9 Release&#8211; any good?'>AxCMS.net v9 Release&#8211; any good?</a></li>
<li><a href='http://codeblog.shawson.co.uk/jquery-accordion-control-links-not-working/' rel='bookmark' title='JQuery Accordion Control links not working'>JQuery Accordion Control links not working</a></li>
<li><a href='http://codeblog.shawson.co.uk/asp-net-update-panels-and-jquery/' rel='bookmark' title='ASP.net update panel&#8217;s and jQuery'>ASP.net update panel&#8217;s and jQuery</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Couple of interesting items popped up in the RRS feed&#8217;s this morning.</p>
<p><a href="http://weblogs.asp.net/scottgu/archive/2010/09/13/automating-deployment-with-microsoft-web-deploy.aspx">Automating Deployment with Microsoft Web Deploy  &#8211; ScottGu&#8217;s Blog</a>.</p>
<p><a href="http://weblogs.asp.net/karan/archive/2010/09/12/calling-server-side-method-using-jquery-ajax.aspx">Calling Server Side Method Using jQuery/Ajax &#8211; Karan&#8217;s Blog</a>.</p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/axcms-net-v9-release-any-good/' rel='bookmark' title='AxCMS.net v9 Release&#8211; any good?'>AxCMS.net v9 Release&#8211; any good?</a></li>
<li><a href='http://codeblog.shawson.co.uk/jquery-accordion-control-links-not-working/' rel='bookmark' title='JQuery Accordion Control links not working'>JQuery Accordion Control links not working</a></li>
<li><a href='http://codeblog.shawson.co.uk/asp-net-update-panels-and-jquery/' rel='bookmark' title='ASP.net update panel&#8217;s and jQuery'>ASP.net update panel&#8217;s and jQuery</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/msdeploy-setup-and-calling-server-side-method-using-jqueryajax-karans-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why ASMX web services are not an excuse anymore with WCF 4.0 &#8211; Pablo M. Cibraro (aka Cibrax)</title>
		<link>http://codeblog.shawson.co.uk/why-asmx-web-services-are-not-an-excuse-anymore-with-wcf-4-0-pablo-m-cibraro-aka-cibrax/</link>
		<comments>http://codeblog.shawson.co.uk/why-asmx-web-services-are-not-an-excuse-anymore-with-wcf-4-0-pablo-m-cibraro-aka-cibrax/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 19:43:16 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[C#.net]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=774</guid>
		<description><![CDATA[Why ASMX web services are not an excuse anymore with WCF 4.0 &#8211; Pablo M. Cibraro (aka Cibrax). Related posts:WCF Services with both JSON and SOAP endpoints Making your WCF Service compatible with legacy .net 1.1 applications Web Services Debugging with Fiddler 2


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/wcf-services-with-json-and-soap-endpoints/' rel='bookmark' title='WCF Services with both JSON and SOAP endpoints'>WCF Services with both JSON and SOAP endpoints</a></li>
<li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
<li><a href='http://codeblog.shawson.co.uk/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><a href="http://weblogs.asp.net/cibrax/archive/2010/09/06/why-asmx-web-services-are-not-an-excuse-anymore-with-wcf-4-0.aspx">Why ASMX web services are not an excuse anymore with WCF 4.0 &#8211; Pablo M. Cibraro (aka Cibrax)</a>.</p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/wcf-services-with-json-and-soap-endpoints/' rel='bookmark' title='WCF Services with both JSON and SOAP endpoints'>WCF Services with both JSON and SOAP endpoints</a></li>
<li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
<li><a href='http://codeblog.shawson.co.uk/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/why-asmx-web-services-are-not-an-excuse-anymore-with-wcf-4-0-pablo-m-cibraro-aka-cibrax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with WCF and REST web services</title>
		<link>http://codeblog.shawson.co.uk/getting-started-with-wcf-and-rest-web-services/</link>
		<comments>http://codeblog.shawson.co.uk/getting-started-with-wcf-and-rest-web-services/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 09:03:07 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=465</guid>
		<description><![CDATA[I&#8217;m building some REST WCF services at the moment and found this great guide online www.robbagby.com/rest/rest-in-wcf-blog-series-index The HiREST stuff shows you how to create fully fledged REST services utilising all of the HTTP verbs. Heres a quick summary of the most useful bits; The service itself is just added to the project as a normal [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/wcf-services-with-json-and-soap-endpoints/' rel='bookmark' title='WCF Services with both JSON and SOAP endpoints'>WCF Services with both JSON and SOAP endpoints</a></li>
<li><a href='http://codeblog.shawson.co.uk/properties-getting-k__backingfield-appended-to-their-name-in-the-wsdl-file/' rel='bookmark' title='Properties getting &#8220;k__BackingField&#8221; appended to their name in the WSDL file'>Properties getting &#8220;k__BackingField&#8221; appended to their name in the WSDL file</a></li>
<li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m building some REST WCF services at the moment and found this great guide online <a href="http://www.robbagby.com/rest/rest-in-wcf-blog-series-index">www.robbagby.com/rest/rest-in-wcf-blog-series-index</a></p>
<p>The HiREST stuff shows you how to create fully fledged REST services utilising all of the HTTP verbs.</p>
<p>Heres a quick summary of the most useful bits;</p>
<p>The service itself is just added to the project as a normal WCF service.  The following needs adding to the Web.config to setup the end </p>
<p>points;</p>
<pre class="brush: xml">
&lt;system.serviceModel&gt;
  &lt;behaviors&gt;
    &lt;endpointBehaviors&gt;
      &lt;behavior name=&quot;AJAXFriendly&quot;&gt;
        &lt;enableWebScript /&gt;
      &lt;/behavior&gt;
      &lt;behavior name=&quot;RESTFriendly&quot;&gt;
        &lt;webHttp /&gt;
      &lt;/behavior&gt;
    &lt;/endpointBehaviors&gt;
&lt;/behaviors&gt;

&lt;services&gt;
    &lt;service      name=&quot;MyNamespace.AjaxServiceClassName&quot;&gt;
      &lt;endpoint   address=&quot;&quot;
        behaviorConfiguration=&quot;AJAXFriendly&quot;
        binding=&quot;webHttpBinding&quot;
        contract=&quot;CatalogService&quot; /&gt;
    &lt;/service&gt;
    &lt;service      name=&quot;MyNamespace.RESTServiceClassName&quot;&gt;
      &lt;endpoint   address=&quot;&quot;
        behaviorConfiguration=&quot;RESTFriendly&quot;
        binding=&quot;webHttpBinding&quot;
        contract=&quot;MyNamespace.IRESTServiceInterfaceName&quot; /&gt;
    &lt;/service&gt;
  &lt;/services&gt;
&lt;/system.serviceModel&gt;
</pre>
<p>Remember the class names in the web.config need to be fully qualified.</p>
<p>An example class for passing around the service;</p>
<pre class="brush: csharp">
[DataContract]
public class ProductData
{
    [DataMember]
    public int ProductId;

    [DataMember]
    public string ProductName;

    [DataMember]
    public string Description;

    [DataMember]
    public decimal Price;

    [DataMember]
    public string ProductImage;
}
</pre>
<p>The service itself is just a normal WCF service so consists of its usual two parts- the interface and the class.  Here&#8217;s an example interface </p>
<p>demoing the various access methods and return serialisations;</p>
<pre class="brush: csharp">
    [ServiceContract]
    public interface IRESTServiceInterfaceName
    {
        // responds to a GET request to www.mysite.com/Servicename.svc/products/
        // return is serialised to JSON
        [OperationContract]
        [WebGet(UriTemplate = &quot;products/&quot;, ResponseFormat = WebMessageFormat.Json)]
        List&lt;FlotChartSeries&gt; GetProducts();

        // responds to a GET request to www.mysite.com/Servicename.svc/products/{product_id}
        // return is serialised to JSON
        [OperationContract]
        [WebGet(UriTemplate = &quot;products/{product_id}&quot;, ResponseFormat = WebMessageFormat.Json)]
        List&lt;FlotChartSeries&gt; GetProductById(string product_id);

        // responds to a GET request to www.mysite.com/Servicename.svc/products?brand={brand}
        // return is serialised to JSON
        [OperationContract]
        [WebGet(UriTemplate = &quot;products?brand={brand}&quot;, ResponseFormat = WebMessageFormat.Json)]
        List&lt;FlotChartSeries&gt; GetProductsByBrand(string brand);

	// responds to a POST, but still passing a bunch of parameters into the querystring
	// no return type
        [WebInvoke(Method = &quot;POST&quot;, UriTemplate = &quot;product/{product_id}/rate?score={score}&quot;)]
        [OperationContract]
        void PostProductAppRating(string product_id, string score);

	// accepts a POST with a JSON encoded product data, to allow for an update
	// no return
	[WebInvoke(Method = &quot;POST&quot;, UriTemplate = &quot;product/{product_id}&quot;, RequestFormat = WebMessageFormat.Json)]
	void PostProductUpdate(string product_id, ProductData data);

	//responds to a PUT- passing a querystring variable for the filename- it expects the body of the push request to be a file stream
	// no return type
        [WebInvoke(Method = &quot;PUT&quot;, UriTemplate = &quot;products/{product_id}/desktopimage?filename={file_name}&quot;)]
        [OperationContract]
        void PutProductImage(string product_id, string file_name, Stream fileContents);

    }
</pre>
<p>Note the variables in the curly braces must match the real parameters to the method signitures for the value to be automatically mapped.</p>
<p>Responses are generally done using HTTP response codes.  At the top of each method you need to grab the current WebOperationContext which </p>
<p>will allow you to set the return codes;</p>
<pre class="brush: csharp">
    WebOperationContext ctx = WebOperationContext.Current;

    ctx.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.OK;		// .. if everything is ok!
    ctx.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.BadRequest;	// on error
    ctx.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.Created;	// after an insert

    // all of the http response codes are mapped here

    ctx.OutgoingResponse.SetStatusAsNotFound(); // if record cannot be found or similar
</pre>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/wcf-services-with-json-and-soap-endpoints/' rel='bookmark' title='WCF Services with both JSON and SOAP endpoints'>WCF Services with both JSON and SOAP endpoints</a></li>
<li><a href='http://codeblog.shawson.co.uk/properties-getting-k__backingfield-appended-to-their-name-in-the-wsdl-file/' rel='bookmark' title='Properties getting &#8220;k__BackingField&#8221; appended to their name in the WSDL file'>Properties getting &#8220;k__BackingField&#8221; appended to their name in the WSDL file</a></li>
<li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/getting-started-with-wcf-and-rest-web-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Properties getting &#8220;k__BackingField&#8221; appended to their name in the WSDL file</title>
		<link>http://codeblog.shawson.co.uk/properties-getting-k__backingfield-appended-to-their-name-in-the-wsdl-file/</link>
		<comments>http://codeblog.shawson.co.uk/properties-getting-k__backingfield-appended-to-their-name-in-the-wsdl-file/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 16:58:08 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=419</guid>
		<description><![CDATA[I was finding k__backingField was being appended to all my object properties when exposed via my a WCF service, in the WSDL.  The solution it turns out was simple- just had to make my class a [DataContract] and mark the properties as [DataMember]. via WCF Data Contracts and “k__BackingField” Property Naming &#8211; Nathan Bridgewater. Related [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/getting-started-with-wcf-and-rest-web-services/' rel='bookmark' title='Getting started with WCF and REST web services'>Getting started with WCF and REST web services</a></li>
<li><a href='http://codeblog.shawson.co.uk/conditional-dataannotations-in-c/' rel='bookmark' title='Conditional DataAnnotations in c#'>Conditional DataAnnotations in c#</a></li>
<li><a href='http://codeblog.shawson.co.uk/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>I was finding k__backingField was being appended to all my object properties when exposed via my a WCF service, in the WSDL.  The solution it turns out was simple- just had to make my class a [DataContract] and mark the properties as [DataMember].</p>
<p>via <a href="http://www.integratedwebsystems.com/2009/05/wcf-data-contracts-and-k__backingfield-property-naming/">WCF Data Contracts and “k__BackingField” Property Naming &#8211; Nathan Bridgewater</a>.</p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/getting-started-with-wcf-and-rest-web-services/' rel='bookmark' title='Getting started with WCF and REST web services'>Getting started with WCF and REST web services</a></li>
<li><a href='http://codeblog.shawson.co.uk/conditional-dataannotations-in-c/' rel='bookmark' title='Conditional DataAnnotations in c#'>Conditional DataAnnotations in c#</a></li>
<li><a href='http://codeblog.shawson.co.uk/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/properties-getting-k__backingfield-appended-to-their-name-in-the-wsdl-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making your WCF Service compatible with legacy .net 1.1 applications</title>
		<link>http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/</link>
		<comments>http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 14:01:42 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=414</guid>
		<description><![CDATA[I&#8217;m building an error tracking service which all our future web project will report to, so we can track and tag all our various systems problems from one place- this is currently done with email which is a bit of a nightmare! According to Microsoft, traditional ASMX web services are now considered &#8220;Legacy technology&#8221; (!) [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/wcf-services-with-json-and-soap-endpoints/' rel='bookmark' title='WCF Services with both JSON and SOAP endpoints'>WCF Services with both JSON and SOAP endpoints</a></li>
<li><a href='http://codeblog.shawson.co.uk/getting-started-with-wcf-and-rest-web-services/' rel='bookmark' title='Getting started with WCF and REST web services'>Getting started with WCF and REST web services</a></li>
<li><a href='http://codeblog.shawson.co.uk/grabbing-data-from-the-registry-on-a-remote-machine-using-dot-net-and-wmi/' rel='bookmark' title='Grabbing data from the registry on a remote machine using dot net and WMI'>Grabbing data from the registry on a remote machine using dot net and WMI</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m building an error tracking service which all our future web project will report to, so we can track and tag all our various systems problems from one place- this is currently done with email which is a bit of a nightmare!</p>
<p>According to Microsoft, traditional ASMX web services are now considered &#8220;Legacy technology&#8221; (!) so I thought I would buite the bullet and build the new services using WCF.</p>
<p>This was fairly painless until I tried to consume the web service in some old .net 1.1 web apps- when trying to add the web reference I received this error message;</p>
<blockquote><p>Web ReferenceslocalhostReference.map(1): Custom tool warning: DiscoCodeGenerator unable to initialize code generator.  No code generated.</p></blockquote>
<p>I found a great article over on the MSDN &#8211; and all it takes is a small change to the web.config, fiddling with, <a href="http://www.shawson.co.uk/codeblog/the-provided-uri-scheme-http-is-invalid-expected-https/">my old friend</a>, the httpBindings.</p>
<p>I had to swap out the default bindings put in by .net;</p>
<pre class="brush: xml">
        &lt;endpoint address=&quot;&quot; binding=&quot;wsHttpBinding&quot; contract=&quot;HachetteErrorTracker.IErrorLog&quot;&gt;
					&lt;identity&gt;
						&lt;dns value=&quot;localhost&quot;/&gt;
					&lt;/identity&gt;
				&lt;/endpoint&gt;
</pre>
<p>For this one;</p>
<pre class="brush: xml">
&lt;endpoint
           address=&quot;&quot;
           binding=&quot;basicHttpBinding&quot; bindingNamespace=&quot;http://errortracker.localhost/&quot;
           contract=&quot;HachetteErrorTracker.IErrorLog&quot;
        /&gt;
</pre>
<p><a href="http://msdn.microsoft.com/en-us/library/ms731134.aspx">How to: Configure WCF Service to Interoperate with ASP.NET Web Service Clients</a>.</p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/wcf-services-with-json-and-soap-endpoints/' rel='bookmark' title='WCF Services with both JSON and SOAP endpoints'>WCF Services with both JSON and SOAP endpoints</a></li>
<li><a href='http://codeblog.shawson.co.uk/getting-started-with-wcf-and-rest-web-services/' rel='bookmark' title='Getting started with WCF and REST web services'>Getting started with WCF and REST web services</a></li>
<li><a href='http://codeblog.shawson.co.uk/grabbing-data-from-the-registry-on-a-remote-machine-using-dot-net-and-wmi/' rel='bookmark' title='Grabbing data from the registry on a remote machine using dot net and WMI'>Grabbing data from the registry on a remote machine using dot net and WMI</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https</title>
		<link>http://codeblog.shawson.co.uk/the-provided-uri-scheme-http-is-invalid-expected-https/</link>
		<comments>http://codeblog.shawson.co.uk/the-provided-uri-scheme-http-is-invalid-expected-https/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 16:28:26 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[VB.net]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=207</guid>
		<description><![CDATA[Going from dev to live, where the dev system referenced dev version of web services, but the live system has to reference live versions which are HTTPS i recieved this error; The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https This is resolved simply by updating the web.config file and setting the security tag&#8217;s mode [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
<li><a href='http://codeblog.shawson.co.uk/wcf-services-with-json-and-soap-endpoints/' rel='bookmark' title='WCF Services with both JSON and SOAP endpoints'>WCF Services with both JSON and SOAP endpoints</a></li>
<li><a href='http://codeblog.shawson.co.uk/uh-oh-important-asp-net-security-vulnerability-scottgus-blog/' rel='bookmark' title='Uh Oh! Important: ASP.NET Security Vulnerability &#8211; ScottGu&#8217;s Blog'>Uh Oh! Important: ASP.NET Security Vulnerability &#8211; ScottGu&#8217;s Blog</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Going from dev to live, where the dev system referenced dev version of web services, but the live system has to reference live versions which are HTTPS i recieved this error;</p>
<blockquote><p>The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https</p></blockquote>
<p>This is resolved simply by updating the web.config file and setting the security tag&#8217;s mode attribute from None to Transport;</p>
<pre class="brush: xml">&lt;bindings&gt;
&lt;wsHttpBinding&gt;
&lt;binding name=&quot;WSHttpBinding_IWSHttpService&quot; closeTimeout=&quot;00:01:00&quot;
openTimeout=&quot;00:01:00&quot; receiveTimeout=&quot;00:10:00&quot; sendTimeout=&quot;00:01:00&quot;
bypassProxyOnLocal=&quot;false&quot; transactionFlow=&quot;false&quot; hostNameComparisonMode=&quot;StrongWildcard&quot;
maxBufferPoolSize=&quot;524288&quot; maxReceivedMessageSize=&quot;65536&quot;
messageEncoding=&quot;Text&quot; textEncoding=&quot;utf-8&quot; useDefaultWebProxy=&quot;true&quot;
allowCookies=&quot;false&quot;&gt;
&lt;readerQuotas maxDepth=&quot;32&quot; maxStringContentLength=&quot;8192&quot; maxArrayLength=&quot;16384&quot;
maxBytesPerRead=&quot;4096&quot; maxNameTableCharCount=&quot;16384&quot; /&gt;
&lt;reliableSession ordered=&quot;true&quot; inactivityTimeout=&quot;00:10:00&quot;
enabled=&quot;false&quot; /&gt;
&lt;security mode=&quot;Transport&quot;&gt;
&lt;transport clientCredentialType=&quot;None&quot; proxyCredentialType=&quot;None&quot;
realm=&quot;&quot; /&gt;
&lt;message clientCredentialType=&quot;None&quot; negotiateServiceCredential=&quot;true&quot;
algorithmSuite=&quot;Default&quot; establishSecurityContext=&quot;true&quot; /&gt;
&lt;/security&gt;
&lt;/binding&gt;
&lt;/wsHttpBinding&gt;
&lt;/bindings&gt;</pre>
<p><a href="http://social.msdn.microsoft.com/forums/en-US/wcf/thread/e46e03f7-dc6d-40fd-a718-81784fc8b154">The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https</a>.</p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
<li><a href='http://codeblog.shawson.co.uk/wcf-services-with-json-and-soap-endpoints/' rel='bookmark' title='WCF Services with both JSON and SOAP endpoints'>WCF Services with both JSON and SOAP endpoints</a></li>
<li><a href='http://codeblog.shawson.co.uk/uh-oh-important-asp-net-security-vulnerability-scottgus-blog/' rel='bookmark' title='Uh Oh! Important: ASP.NET Security Vulnerability &#8211; ScottGu&#8217;s Blog'>Uh Oh! Important: ASP.NET Security Vulnerability &#8211; ScottGu&#8217;s Blog</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/the-provided-uri-scheme-http-is-invalid-expected-https/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Visually build XPath using &#8220;Sketch Path&#8221;</title>
		<link>http://codeblog.shawson.co.uk/visually-build-xpath-using-sketch-path/</link>
		<comments>http://codeblog.shawson.co.uk/visually-build-xpath-using-sketch-path/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 10:59:44 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[Web Services]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XPath]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=202</guid>
		<description><![CDATA[Paul found an awesome tool fopr visually parsing XML files and building XPath statements, called Sketch Path available for download here Related posts:Consuming RSS Feeds using ASP.net controls Web Services Debugging with Fiddler 2 Making your WCF Service compatible with legacy .net 1.1 applications


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/consuming-rss-feeds-using-asp-net-controls/' rel='bookmark' title='Consuming RSS Feeds using ASP.net controls'>Consuming RSS Feeds using ASP.net controls</a></li>
<li><a href='http://codeblog.shawson.co.uk/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
<li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Paul found an awesome tool fopr visually parsing XML files and building XPath statements, called <a href="http://pgfearo.googlepages.com/home" target="_blank">Sketch Path available for download here</a></p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/consuming-rss-feeds-using-asp-net-controls/' rel='bookmark' title='Consuming RSS Feeds using ASP.net controls'>Consuming RSS Feeds using ASP.net controls</a></li>
<li><a href='http://codeblog.shawson.co.uk/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
<li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/visually-build-xpath-using-sketch-path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick XML serialisation of an object..</title>
		<link>http://codeblog.shawson.co.uk/quick-xml-serialisation-of-an-object/</link>
		<comments>http://codeblog.shawson.co.uk/quick-xml-serialisation-of-an-object/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 13:16:03 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=197</guid>
		<description><![CDATA[Quick code snippet for taking a serialisable object, serialising to XMl then spitting out a string for you to write out to a debug log or something- i used this for spitting back the responses I was getting from a web service call i was making StringBuilder sb_xml = new StringBuilder(); XmlSerializer s = new [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/a-complete-list-of-net-serializers-in-3-5/' rel='bookmark' title='A complete list of .NET Serializers in 3.5'>A complete list of .NET Serializers in 3.5</a></li>
<li><a href='http://codeblog.shawson.co.uk/syndicating-to-rss-using-the-build-in-net-syndicationfeed-classes/' rel='bookmark' title='Syndicating to RSS using the built in .net SyndicationFeed classes'>Syndicating to RSS using the built in .net SyndicationFeed classes</a></li>
<li><a href='http://codeblog.shawson.co.uk/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Quick code snippet for taking a serialisable object, serialising to XMl then spitting out a string for you to write out to a debug log or something- i used this for spitting back the responses I was getting from a web service call i was making</p>
<pre class="brush: csharp">
            StringBuilder sb_xml = new StringBuilder();
            XmlSerializer s = new XmlSerializer( typeof( Hachette.Checkout.Vista.Stock.ProductStockLiteResultResponse ) );
            StringWriter w = new StringWriter(sb_xml);
            s.Serialize(w, ws_response);
            w.Close();
            Response.Write(&quot;&lt;!-- Response = &quot; + sb_xml + &quot; --&gt;&quot;);
</pre>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/a-complete-list-of-net-serializers-in-3-5/' rel='bookmark' title='A complete list of .NET Serializers in 3.5'>A complete list of .NET Serializers in 3.5</a></li>
<li><a href='http://codeblog.shawson.co.uk/syndicating-to-rss-using-the-build-in-net-syndicationfeed-classes/' rel='bookmark' title='Syndicating to RSS using the built in .net SyndicationFeed classes'>Syndicating to RSS using the built in .net SyndicationFeed classes</a></li>
<li><a href='http://codeblog.shawson.co.uk/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/quick-xml-serialisation-of-an-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

