Feeds:
Posts
Comments

Archive for the ‘WCF’ Category

The task at hand is to create an ESB OnRamp service on IIS 6. I hope this is an error of the past – but incase you don’t have a choice in choosing your IIS version AND windows 2003 – I’ve listed down the potential errors and a resolution

As you try to deploy your OnRamp, most likely you’ll come across the following two errors

Error # 1

Event Type:           Error
Event Source:       System.ServiceModel 3.0.0.0
Event Category:    WebHost
Event ID:                3
Date:                      28/08/2012
Time:                      12:40:03 AM
User:                      MYDOMAIN\btservice
Computer:             zeeWS2003

Description:

WebHost failed to process a request.

 Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/37990405

 Exception: System.ServiceModel.ServiceActivationException: The service ‘/MYCUSTOMWCFAPP.GENERICWCF.ONEWAY/GenericOneWayService.svc’ cannot be activated due to an exception during compilation.  The exception message is: Receive location for address “/MYCUSTOMWCFAPP.GENERICWCF.ONEWAY/GenericOneWayService.svc” not found. (The BizTalk receive location may be disabled.). —> Microsoft.BizTalk.Adapter.Wcf.AdapterException: Receive location for address “/MYCUSTOMWCFAPP.GENERICWCF.ONEWAY/GenericOneWayService.svc” not found. (The BizTalk receive location may be disabled.)

   at Microsoft.BizTalk.Adapter.Wcf.Runtime.ReceiveLocationManager`2.GetEndpointContext(Uri uri)

   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WebServiceHostFactory`3.CreateServiceHost(String constructorString, Uri[] baseAddresses)

   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)

   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)

   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)

   — End of inner exception stack trace —

   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)

   at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)

 Process Name: w3wp
Process ID: 5236

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

——————————-

The second error in the event viewer:
Error # 2:

Event Type:           Error
Event Source:       System.ServiceModel 3.0.0.0
Event Category:    WebHost
Event ID:                3
Date:                      28/08/2012
Time:                      12:40:03 AM
User:                      MYDOMAIN\btservice
Computer:            
zeeWS2003

Description:

WebHost failed to process a request.

 Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/37990405

 Exception: System.ServiceModel.ServiceActivationException: The service ‘/MYCUSTOMWCFAPP.GENERICWCF.ONEWAY/GenericOneWayService.svc’ cannot be activated due to an exception during compilation.  The exception message is: Receive location for address “/MYCUSTOMWCFAPP.GENERICWCF.ONEWAY/GenericOneWayService.svc” not found. (The BizTalk receive location may be disabled.). —> Microsoft.BizTalk.Adapter.Wcf.AdapterException: Receive location for address “/MYCUSTOMWCFAPP.GENERICWCF.ONEWAY/GenericOneWayService.svc” not found. (The BizTalk receive location may be disabled.)

   at Microsoft.BizTalk.Adapter.Wcf.Runtime.ReceiveLocationManager`2.GetEndpointContext(Uri uri)

   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WebServiceHostFactory`3.CreateServiceHost(String constructorString, Uri[] baseAddresses)

   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)

   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)

   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)

   — End of inner exception stack trace —

   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)

   at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)

 Process Name: w3wp

 Process ID: 5236

 For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

———————————————-

 

Solution:
The only way I could get around it, was  to enable 32 bit  on this (f@#*$n!) 64 bit Windows 2003 machine. Run the following steps on your command prompt (not as a script!  – follow them one after the other):

1.       cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
%SYSTEMROOT%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i

2.       cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

3.       Make sure that the status of ASP.NET version 2.0.50727 (32-bit) is set to Allowed in the Web service extension list in Internet Information Services Manager.
MSDN Page: http://support.microsoft.com/kb/894435

4.       cd C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation
ServiceModelReg.exe –i

5.       As a last resort, delete the receive location in BizTalk and recreate it

6.       Make sure the service has rights to access the receive location

I hope this solves it !

Read Full Post »

I was assigned the task of hosting my .NET WCF service on IIS 6 over windows 2003 64 bit !!. (Don’t ask – I didn’t have a choice on the parameters involved!)

I found out that Application Extensions were missing under my deployed website, ie no svc extension.
Path: under IIS –> Default Web Site –> MySite.WCF –> Properties –> Configuration

Solution:

It appears to be quite a  simple fix by running the aspnet extension registration. Screen shot as follows:

Happy configuring !

Read Full Post »

I’ve a 64bit machine that has a web-service hosted under IIS6!. This starts throwing out errors one morning as I browse to my .svc location – “Page not found 404 Error

 Solution:

  1. Check that the isapi.dll is pointing to v2.0
    C:\WINDOWS\microsoft.net\Framework\v2.0.50727\It appears that an overnight .NET 4 installation was pushed out and IIS 6 extensions were mapped to .NET v4. To resolve this, I manually changed the .svc extension in IIS 6 to v2.0+.
    Screen shot of my machine (under IIS –> Default Web Site –> MySite.WCF)  before I made the change
    After the change:
    Now pointing to : C:\WINDOWS\microsoft.net\Framework\v2.0.50727\aspnet_isapi.dll

    Make sure to restart IIS

    Optional
    :
  2. Make sure your IIS service account has access to the C:\windows\temp folder. Your WCF service generates temporary files behind the scene and skipping this might display errors such as: System.InvalidOperationException: Unable to generate a temporary class
  3. From your command prompt run the following command
    aspnet_regiis.exe -i –enable     
  4. Then (command prompt again),
                   cd C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation
                   ServiceModelReg.exe -i
  5. If it still doesn’t solve it, follow this MSDN article
    Location: http://msdn.microsoft.com/en-us/library/ms752252(VS.90).aspx
    Happy setting up 🙂

Read Full Post »

This is a handy snippet to remove namespaces from an xml document.

XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(@"C:\SampleInput.xml");
string xmlText = xmlDocument.OuterXml;
xmlText = System.Text.RegularExpressions.Regex.Replace(
              xmlText, @"(xmlns:?[^=]*=[""][^""]*[""])", "",
              System.Text.RegularExpressions.RegexOptions.IgnoreCase |
              System.Text.RegularExpressions.RegexOptions.Multiline);

Happy coding 🙂

Read Full Post »

The BizTalk Adapter (v2.0) pack provides several WCF adapters to connect to LOB systems. Looking at the SQL adapter to explain how does the magic happen 🙂

 01 Architecture

Follow the comments on the right marked in GREEN that describes how a call from BizTalk gets communicated with the SQL database (with ADO.Net as the intermediary). The concept would be pretty similar to other LOB adapters such as Siebel, SAP and Oracle. The fundamental concept is the translation of messages from our client (BizTalk) →WCF stack (SOAP calls) → Destination System (underlying API)

Hope it helps.. Happy learning 🙂

Read Full Post »

WCF: The WCF Model

Here is a good reference diagram for the WCF space. It shows the various entities involved while structuring your WCF service – a great way to model and build your WCF services/solutions.

WcfModel

Happy model-ling 🙂

Read Full Post »

There have been a few updates on the BizTalk front – especially with 2009 beta being released recently. With that, here are a few whitepapers/downloads that got me interested…

 

 

1)    Using the WCF adapters in BizTalk 2006 R2

Link: Click here 

 

2)    WCF, WF and .NET 3.5 Whitepapers

Link: Click here 

 

3)    Modifying Messages with the WCF Adapters

Link: Click here 

 

4)    Using Custom Behaviors with the BizTalk WCF Adapters,

Part 1: Click here

 

Part 2: Click here

 

5)    BizTalk 2006 R2 Documentation – updated

Link: Click here

 

6)    BizTalk 2009 Beta Documentation

Link: Click here

 

7)    BizTalk 2009 Database infrastructure poster

Link: Click here

Happy learning 🙂

Read Full Post »