December 13, 2009
@ 11:41 AM

If you are interested in added Bing.com maps into your web sites, check out the SDK's below:

Bing Maps AJAX Control SDK 6.2

This software development kit (SDK) provides programming reference and how-to topics for getting started with the Bing Maps AJAX Control.

Bing Maps Web Services SDK 1.0

This software development kit (SDK) provides programming reference and how-to topics for getting started with the Bing Maps Web Services

Bing Maps Silverlight Control SDK

This software development kit (SDK) provides the binaries and programming reference for the Bing Maps Silverlight Control.


 
Categories: AJAX | ASP.NET | Link | Web Services

I hope everyone in Arizona and southern California is planning to attend this years Desert Code Camp on 6/13 and SoCal Code Camp in San Diego on 6/27 - 6/28. It's always a great time and lots of free training! I will also be selling a limited number of my latest book "David McCarter's .NET Coding Standards" at my sessions for $12, cheaper than the web site (no tax and shipping), please bring exact change or check.

I will be presenting the following sessions and I hope you will attend. Also, check out my new .NET discussion site called DotNet Army!

Building nTier Applications with Entity Framework Services

Learn how to build real world nTier applications with the new Entity Framework and related services introduced in .NET 3.5 SP1. With this new technology built into .NET, you can easily wrap an object model around your database and have all the data access automatically generated or use your own stored procedures and views. Then learn how to easily and securely expose your object model using WCF with just a few line of code using ADO.NET Data Services. The session will demonstrate how to create and consume these new technologies from the ground up. Lots of code!

Slides: Building nTier Applications with Entity Framework Services.pdf (2.88 MB)
Demo Code: EntityFramework.zip (859.84 KB)


dotNetDave's Favorite Programming Tools

This session will focus on my favorite Visual Studio add-ins and other tools that makes programming faster and easier. I will focus on tools that are either free or very affordable. Tool categories include Writing Better Code (easier, faster and correct the first time!), Code Helpers, Documentation (helper and creation), General Utilities and more. These tools are designed to impress your boss and get you home at a reasonable time. Packed full of demonstrations and very few PowerPoint slides! Licenses for some of the 3rd party products I will be demonstrating will be given away, so be sure to attend and bring a business card!

Slides: dotNetDave's Favorite Programming Tools.pdf (1.82 MB)

Building Rich & Interactive Web Applications with ASP.NET AJAX

Learn how to build rich web application interfaces using ASP.NET AJAX and the ASP.NET AJAX Control Toolkit. This new technology makes programming JavaScript into your ASP.NET pages easy, increasing the power and functionality of your applications, reducing round trips to the server, and making it easy to consume web services for dynamic content. In this session you will be introduced to the new client and server controls for ASP.NET and Java Script to learn how to build a rich Web 2.0 experience for your users.

Slides: Building Rich & Interactive Web Applications with ASP.NET AJAX - 2009.pdf (2.36 MB)
Demo Code: AdventureWorksAjax.zip (803.65 KB)

Why You Need .NET Coding Standards (2009)

This session will guide any level of programmer to greater productivity by providing the information needed to write consistent, maintainable code. Learn about project setup, assembly layout, code style, defensive programming and much, much more. We will even go over some real in production code and see what the programmer did wrong in "What's Wrong With this Code?". Code tips are included to help you write better, error free applications. Lots of code examples in C# and VB.NET.

Slides: Why You Need .NET Coding Standards-2009.pdf (3.8 MB)
Demo Code: CodingStandards.zip (245.54 KB)


Pictures and Video

SoCal CodeCamp Fullerton - 2009

Pictures from This Years Code Camp:

Pictures from past SoCal Code Camps:

Video from past Code Camps:


 
Categories: .NET | ADO.NET | AJAX | ASP.NET | C# | Code Camp | Defensive Programming | dotNetDave | Entity Framework | Generics | LINQ | VB.NET | VS.NET | WCF | Web Services

January 9, 2009
@ 03:19 PM
I hope everyone in southern California is planning to attend this years SoCal Code Camp at Cal State Fullerton on 1/24 - 1/25. It's always a great time and lots of free training! I will also be selling a limited number of my latest book "David McCarter's .NET Coding Standards" at my sessions for $11, cheaper than the web site (no tax and shipping), please bring exact change.

I will be presenting the following sessions and I hope you will attend. Also, check out my new .NET discussion site called DotNet Army!

Building nTier Applications with Entity Framework Services

1:30PM Saturday - Room: UH 246

Learn how to build real world nTier applications with the new Entity Framework and related services introduced in .NET 3.5 SP1. With this new technology built into .NET, you can easily wrap an object model around your database and have all the data access automatically generated or use your own stored procedures and views. Then learn how to easily and securely expose your object model using WCF with just a few line of code using ADO.NET Data Services. The session will demonstrate how to create and consume these new technologies from the ground up. Lots of code!

Slides: Building nTier Applications with Entity Framework Services.pdf (2.79 MB)
Demo Code: Building nTier Applications with Entity Framework Services.zip (849.73 KB)


dotNetDave's Favorite Programming Tools

1:15PM Saturday - Room: UH 250

This session will focus on my favorite Visual Studio add-ins and other tools that makes programming faster and easier. I will focus on tools that are either free or very affordable. Tool categories include Writing Code (easier, faster and correct the first time!), Code Helpers, Documentation (helper and creation), General Utilities and more. These tools are designed to impress your boss and get you home at a reasonable time. Packed full of demonstrations and very few PowerPoint slides! Licenses for some of the 3rd party products I will be demonstrating will be given away, so be sure to attend and bring a business card!

Slides: dotNetDave's Favorite Programming Tools.pdf (1.8 MB)

Building Rich & Interactive Web Applications with ASP.NET AJAX

11:30AM Saturday - Room: MH 121

Learn how to build rich web application interfaces using ASP.NET AJAX and the ASP.NET AJAX Control Toolkit. This new technology makes programming JavaScript into your ASP.NET pages easy, increasing the power and functionality of your applications, reducing round trips to the server, and making it easy to consume web services for dynamic content. In this session you will be introduced to the new client and server controls for ASP.NET and Java Script to learn how to build a rich Web 2.0 experience for your users.

Slides: Building Rich & Interactive Web Applications with ASP.NET AJAX - 2009.pdf (2.36 MB)
Demo Code: Building Rich & Interactive Web Applications with ASP.NET AJAX - 20091.zip (702.2 KB) UPDATED!

Why You Need .NET Coding Standards (2009)

2:30PM Saturday - Room: UH 250

This session will guide any level of programmer to greater productivity by providing the information needed to write consistent, maintainable code. Learn about project setup, assembly layout, code style, defensive programming and much, much more. We will even go over some real in production code and see what the programmer did wrong in "What's Wrong With this Code?". Code tips are included to help you write better, error free applications. Lots of code examples in C# and VB.NET.

Slides: Why You Need .NET Coding Standards-2009.pdf (3.46 MB)
Demo Code: Why You Need .NET Coding Standards-2009.zip (94.46 KB)


Pictures and Video

SoCal CodeCamp Fullerton - 2009

Pictures from This Years Code Camp:

Pictures from past SoCal Code Camps:

Video from past Code Camps:


 

Here is some easy, generic code to serialize your objects to and from JSON:

Public Shared Function JsonEncode(ByVal input As Object) As String
  Dim serilizer = New DataContractJsonSerializer(input.GetType)
  Using ms = New MemoryStream()
    serilizer.WriteObject(ms, input)
    Return Encoding.Default.GetString(ms.ToArray())
  End Using
End Function
Public Shared Function JsonDecode(Of T)(ByVal input As String) As T
  Using ms = New MemoryStream(Encoding.Unicode.GetBytes(input))
    Dim serilizer = New DataContractJsonSerializer(GetType(T))
    Return DirectCast(serilizer.ReadObject(ms), T)
  End Using
End Function
public static string JsonEncode(object input)
{
var serilizer = new DataContractJsonSerializer(input.GetType());
  using (var ms = new MemoryStream())
{
serilizer.WriteObject(ms, input);
    return Encoding.Default.GetString(ms.ToArray());
}
}
public static T JsonDecode<T>(string input)
{
using (var ms = new MemoryStream(Encoding.Unicode.GetBytes(input)))
{
var serilizer = new DataContractJsonSerializer(typeof(T));
    return (T)serilizer.ReadObject(ms);
}
}

Tip Submitted By: David McCarter


 
Categories: ASP.NET | C# | JavaScript | VB.NET | Web Services | Generics

One of the features I use often with the Microsoft Web Service Enhancements (WSE) is logging. It's a great feature where it logs everything coming in and out of a web service. When someone calls me with issues, the first thing I do is turn this on in the web.config and watch the data coming and going. The data is stored in two different xml files. One for incoming calls and one for responses.

The problem I just ran into is that I got a call that stated web service calls that were taking about 1 second or less were now taking 20 seconds or even timing out. After working on the issue off and on for two days I discovered that these two WSE log files have grown to 59MB+ because I forgot to turn off logging the last time there was an issue! Once I turned off logging this issue went away.

One symptom that we noticed that made us go down the wrong direction at first was that the w3wp.exe in Task Manager would eat a lot of memory during those 20 seconds and spike the CPU usage up to 99%! When we Googled this, we found lots similar issues, but none relating to the xml log files generated by WSE. We wasted a lot of time on this.

I hope this helps anyone else that uses logging in WSE.

Tip By: David McCarter


 
Categories: Web Services

Microsoft Web service and distributed systems technologies provide the means for software to connect to other software applications in order to build distributed, service-oriented systems.

http://msdn2.microsoft.com/en-us/webservices/default.aspx


 
Categories: dotNetDave | Link | Web Services

December 1, 2006
@ 04:39 PM

The Web Service Software Factory (also known as the Service Factory) is an integrated collection of tools, patterns, source code and prescriptive guidance. It is designed to help you quickly and consistently construct Web services that adhere to well known architecture and design patterns.

For more info, go to: http://msdn2.microsoft.com/en-us/library/aa480534.aspx


 
Categories: Link | Web Services

WSE 2.0 SP3 simplifies the development and deployment of secure Web services by enabling developers and administrators to more easily apply security policies on Web services running on the .NET Framework. Using WSE, Web services communication can be signed and encrypted using Kerberos tickets, X.509 certificates, username/password credentials, and other custom binary and XML-based security tokens. In addition, an enhanced security model provides a policy-driven foundation for securing Web services across trust domains. WSE also supports the ability to establish a trust-issuing service for retrieval and validation of security tokens, as well as the ability to establish more efficient long-running secure communication via secure conversations.

New support for message-oriented programming enables asynchronous communication for Web services that involve long-lived operations, batch processing, peer to peer programs, or event driven application models. Web services that leverage WSE can now be hosted in multiple environments including ASP.NET, standalone executables, NT Services and can communicate over alternative transports including HTTP or TCP.

WSE provides a foundation for building applications based on Web services specifications published by Microsoft and industry partners including WS-Security (OASIS 2004 standard), WS-Policy, WS-SecurityPolicy, WS-Trust, WS-SecureConversation and WS-Addressing.

WSE 2.0 SP3 and WSE 1.0 SP1 can be installed side by side. If you had downloaded the 2.0 technology preview, uninstall it before installing WSE 2.0 SP3. Please review the product readme for more information about WSE 2.0 SP3, including API changes from WSE 1.0.

WSE 2.0 SP3 may be redistributed as part of your solution, provided that redistribution is done using the WSE 2.0 SP3 redistribution MSI, Microsoft WSE 2.0 SP3 Runtime.msi. This MSI is available as a separate download and is also included in the complete WSE 2.0 SP3 download.

WSE 2.0 SP3 is built for developers using Visual Studio .NET 2003 and the .NET Framework 1.1. The WSE support life-cycle policy is in line with the .NET Framework support life-cycle policy. For additional information on this support policy, please check: http://support.microsoft.com/common/international.aspx.
Click here to download.


 
Categories: Web Services

This is the redistributable package for WSE 2.0 SP2. For an overview of WSE 2.0, please see the Web Services Enhancements page.

Click here to download.


 
Categories: Web Services

WSE 2.0 SP2 simplifies the development and deployment of secure Web services by enabling developers and administrators to more easily apply security policies on Web services running on the .NET Framework. Using WSE, Web services communication can be signed and encrypted using Kerberos tickets, X.509 certificates, username/password credentials, and other custom binary and XML-based security tokens. In addition, an enhanced security model provides a policy-driven foundation for securing Web services across trust domains. WSE also supports the ability to establish a trust-issuing service for retrieval and validation of security tokens, as well as the ability to establish more efficient long-running secure communication via secure conversations.

New support for message-oriented programming enables asynchronous communication for Web services that involve long-lived operations, batch processing, peer to peer programs, or event driven application models. Web services that leverage WSE can now be hosted in multiple environments including ASP.NET, standalone executables, NT Services and can communicate over alternative transports including HTTP or TCP.

WSE provides a foundation for building applications based on Web services specifications published by Microsoft and industry partners including WS-Security (OASIS 2004 standard), WS-Policy, WS-SecurityPolicy, WS-Trust, WS-SecureConversation and WS-Addressing.

WSE 2.0 SP2 and WSE 1.0 SP1 can be installed side by side. If you had downloaded the 2.0 technology preview, uninstall it before installing WSE 2.0 SP2. Please review the product readme for more information about WSE 2.0 SP2, including API changes from WSE 1.0.

WSE 2.0 SP2 may be redistributed as part of your solution, provided that redistribution is done using the WSE 2.0 SP2 redistribution MSI, Microsoft WSE 2.0 SP2 Runtime.msi. This MSI is available as a separate download and is also included in the complete WSE 2.0 SP2 download.

WSE 2.0 SP2 is built for developers using Visual Studio .NET 2003 and the .NET Framework 1.1. The WSE support life-cycle policy is in line with the .NET Framework support life-cycle policy. For additional information on this support policy, please check: http://support.microsoft.com/common/international.aspx.

To download, click here.


 
Categories: Web Services

About WSE 2.0 SP1

WSE 2.0 SP1 simplifies the development and deployment of secure Web services by enabling developers and administrators to more easily apply security policies on Web services running on the .NET Framework. Using WSE, Web services communication can be signed and encrypted using Kerberos tickets, X.509 certificates, username/password credentials, and other custom binary and XML-based security tokens. In addition, an enhanced security model provides a policy-driven foundation for securing Web services across trust domains. WSE also supports the ability to establish a trust-issuing service for retrieval and validation of security tokens, as well as the ability to establish more efficient long-running secure communication via secure conversations.

New support for message-oriented programming enables asynchronous communication for Web services that involve long-lived operations, batch processing, peer to peer programs, or event driven application models. Web services that leverage WSE can now be hosted in multiple environments including ASP.NET, standalone executables, NT Services and can communicate over alternative transports including HTTP or TCP.

WSE provides a foundation for building applications based on Web services specifications published by Microsoft and industry partners including WS-Security (OASIS 2004 standard), WS-Policy, WS-SecurityPolicy, WS-Trust, WS-SecureConversation and WS-Addressing.

WSE 2.0 SP1 and WSE 1.0 SP1 can be installed side by side. If you had downloaded the 2.0 technology preview, uninstall it before installing WSE 2.0 SP1. Please review the product readme for more information about WSE 2.0 SP1, including API changes from WSE 1.0.

WSE 2.0 SP1 may be redistributed as part of your solution, provided that redistribution is done using the WSE 2.0 SP1 redistribution MSI, Microsoft WSE 2.0 SP1 Runtime.msi. This MSI is available as a separate download and is also included in the complete WSE 2.0 SP1 download.

WSE 2.0 SP1 is built for developers using Visual Studio .NET 2003 and the .NET Framework 1.1. The WSE support life-cycle policy is in line with the .NET Framework support life-cycle policy. For additional information on this support policy, please check: http://support.microsoft.com/common/international.aspx.

 

To download go to: http://www.microsoft.com/downloads/details.aspx?FamilyID=fc5f06c5-821f-41d3-a4fe-6c7b56423841&DisplayLang=en

 

To download the redistributable, go to: http://www.microsoft.com/downloads/details.aspx?FamilyID=d3c8f18b-7bbf-489d-90e1-e8d4147205b8&DisplayLang=en


 
Categories: Web Services

The exception would be on a (different) strange looking file name each time I would run the web service. For example the file name would be 4drv23rf.dll. Below is the entire error:

System.IO.FileNotFoundException: File or assembly name 4drv23rf.dll, or one of its dependencies, was not found.
File name: "4drv23rf.dll"
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound,
Assembly locationHint, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean stringized,
Evidence assemblySecurity, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity)
   at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
   at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
   at System.Xml.Serialization.Compiler.Compile()
   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings)
   at System.Web.Services.Protocols.XmlReturn.GetInitializers(LogicalMethodInfo[] methodInfos)
   at System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMethodInfo[] methodInfos)
   at System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type type,
LogicalMethodInfo[] methodInfos)
   at System.Web.Services.Protocols.HttpServerType..ctor(Type type)
   at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context,
HttpRequest request, HttpResponse response)
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context,
HttpRequest request, HttpResponse response, Boolean& abortProcessing)
=== Pre-bind state information ===
LOG: Where-ref bind. Location = 4drv23rf.dll
LOG: Appbase = file:///c:/inetpub/wwwroot/WebService1
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom, partial, 
or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/WINDOWS/Temp/4drv23rf.dll.

As you can see from above, the file was always located in my C:\WINDOWS\Temp\ directory. I really have no idea what this file is or why it’s placed in this directory. I thought all temporary ASP.NET files were saved to the C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files location.

After using Google for about an hour to search for solutions, I really did not find anything that seemed to fit my particular problem. Then on the way out the door (from work), I mentioned it to my co-worker. It seems he has had the same issue.

The Solution

It seems that the ASP.NET Machine Account (<machine name>\ASPNET) needs to have read/write access to the Windows temporary directory to create these temporary dll’s. Simply go to that directory, bring up the properties dialog and click on the Security tab. Click Add and add the ASPNET account. Make sure “Write” is checked and press Apply.

Tip By: David McCarter/ Mike Carr


 
Categories: Web Services

This Toolkit offers functionality similar to the MSDN SOAP Toolkit sample, which has been available for several months, but is a fully Microsoft supported product. This Toolkit replaces the old MSDN SOAP Toolkit.

 

http://www.microsoft.com/downloads/details.aspx?familyid=147ed727-0be8-48a1-b1da-d50b1ea582cb&displaylang=en

 

SOAP Toolkit 2.0 Redistributable Files:

http://www.microsoft.com/downloads/details.aspx?familyid=d4490e52-5f6e-4127-9dc7-88b7c8f83b74&displaylang=en


 
Categories: Link | Web Services | XML

SOAP Version 1.2 is a lightweight protocol for exchanging structured information in a decentralized, distributed environment. Visit the Web Services home page.

 

http://www.w3.org/TR/2003/NOTE-soap12-n11n-20031008/


 
Categories: Web Services

September 9, 2003
@ 01:18 AM
Categories: dotNetDave | Link | Web Services | XML

August 12, 2003
@ 02:28 AM

We have seen how it easy it is to write the web service using SOAP as the message protocol, but not how we go about making sure that the web service is secure? Well this downloadable 32 page article will show you how! Here is a taste:

What is a SOAP Fault message?

A SOAP Fault message is used to carry error and/or status information within a SOAP message response. The SOAP Fault element has four sub elements, they are as follows:

  • faultcode – this value is usually either client or server, it lets the receiver know whose “fault” the error was
  • faultstring – this is where the human-readable error message goes, very similar to the Message property of the Exception class
  • faultactor – this element lets the receiver know who caused the error within the message path, unless the message is being routed, this will either be blank or the URI of the web service method
  • detail – this is where all of the detailed error information goes, such as an error stack trace

Here is what a valid SOAP Fault message might look like:


<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Client</faultcode>
      <faultstring>
        The user (timm) could not be authenticated.
      </faultstring>
      <faultactor>
        http://localhost/TestSoapHeadersExample/TestSoapHeaders.asmx
      </faultactor>
      <detail>System.Exception: Authentication failed for user (timm)
        at CustomAuthentication.AuthenticationModule.Authenticate()
        at CustomAuthentication.AuthenticationModule.OnBeginRequest
        (Object source, EventArgs eventArgs)
      </detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>

The .NET Framework makes it very easy to both send and consume SOAP Fault messages from web service clients and web service methods. Any time you throw a SoapException inside of a web service, it is automatically serialized into a valid SOAP Fault message. Conversely, any time a web service client receives a SOAP Fault message, that message is then de-serialized back into a SoapException.

Want to read all of this great article written by Tim McCarthy? Click here to download the PDF of the article. After that, click here to download the sample code. Enjoy!


 
Categories: Web Services