Programming4us
         
 
 
Applications Server

BizTalk Server 2009 : Service-oriented endpoint patterns (part 2)

12/9/2010 3:18:18 PM

While the BizTalk WCF Service Publishing Wizard produces a fairly clean WSDL file, we are clearly establishing more structural control by building these contracts by hand.

The next step is to switch to the BizTalk Administration Console and create a new one-way receive port/receive location combo. I've chosen the WCF-Custom adapter for the receive location which means that the in-process, BizTalkServerApplication host is used.

Now we need to configure this custom endpoint. Skip ahead to the Binding tab within the WCF-Custom Transport Properties window. I've decided that this custom WCF adapter will exploit the basicHTTP binding.

Now, we can switch back to the General tab and assign an HTTP address for this endpoint. I've chosen an arbitrary port number and URI (http://localhost:4044/SiteRegistrationService/service.svc ) to represent this endpoint.

Finally, let's add a new behavior to this endpoint so that service clients can interrogate the WSDL. On the Behavior tab, we right-click the Service Behavior node and choose to Add Extension. In the Select Behavior Extension window, we should choose the serviceMetadata entry. Then, we must be sure to flip the serviceMetadata httpGetEnabled to True. If you recall from our WCF discussion earlier, we use this behavior to explicitly turn metadata retrieval on and off. property named

If we enable this receive location, and browse to the chosen URL, we'll be presented with the standard WCF service description page.

However, if we look at the available WSDL, we'll notice a generic BizTalkSubmit operation and no explicit schema. This makes sense because our receive location has absolutely no idea what type of data we plan on passing to it. Let's help it out, shall we? Go back to the receive location we created, open the adapter configuration window, switch to the Behavior tab and choose the serviceMetadata behavior listed there. This behavior has a property named externalMetadataLocation where we can specify which outside WSDL file should be a substitute for whatever the receive location would have generated on its own. I populated this property with the URL of my hand-built WSDL.

Pitfall

The WSDL file must be accessed through an HTTP or HTTPS channel by the adapter. If you try and point to a WSDL using a file system URI, the receive location will fail to start and throws an error. You can resolve this by placing the WSDL in an IIS web directory and referencing it there.


Now if I browse this service again, I see that the custom WSDL file is served up instead of the auto-generated one.

Notice that I could also use this pattern to accept "generic" content into my receive location and avoid the throwaway orchestration demonstrated in the previous section. Our custom-built WSDL could designate an arbitrary payload for our service operation.


This pattern demonstrates a clean way to attach "type" details to a WCF receive location in a very loosely-coupled way. Note however, that there is no practical reason to avoid hosting our services in IIS 7.0 and choosing the in-process hosting instead. The best part is, an endpoint hosted in IIS can still take advantage of the externalMetadataLocation property set in the corresponding receive location. Hence, this little trick isn't just for in-process hosting but rather, available to any WCF adapter in any hosting environment.

Consider using the "custom" WCF adapters in all situations. In doing so, you get easy access to binding configurations and behaviors that are inaccessible from the transport-specific WCF adapters. Also, if you need to upgrade the capabilities of the port in the future, there is no need to create new ports and rebind existing processes.

Other -----------------
- Exchange Server 2010 : Office Communication Server 2007 R2 Integration (part 3) - Deploying Instant Messaging for OWA
- Exchange Server 2010 : Office Communication Server 2007 R2 Integration (part 2) - Deploying UM and OCS 2007 R2 Integration
- Exchange Server 2010 : Office Communication Server 2007 R2 Integration (part 1) - Integrating OCS 2007 R2 in Exchange 2010 Architecture
- Exchange Server 2010 : Managing Unified Messaging (part 1) - Testing Unified Messaging Functionality
- Exchange Server 2010 : Managing Unified Messaging (part 1)
- Exchange Server 2010 : International Considerations of Unified Messaging
- BizTalk Server 2009 : Service-oriented schema patterns (part 6) - Exploiting generic schemas
- BizTalk Server 2009 : Service-oriented schema patterns (part 5) - Node feature mapping for service clients
- BizTalk Server 2009 : Service-oriented schema patterns (part 4) - Node data type conversion for service clients
- BizTalk Server 2009 : Service-oriented schema patterns (part 3) - Building and applying reusable schema components
- BizTalk Server 2009 : Service-oriented schema patterns (part 2) - Canonical schemas
- BizTalk Server 2009 : Service-oriented schema patterns (part 1) - Designing schemas based on service type
- Exchange Server 2010 : Deploying Unified Messaging (part 3)
- Exchange Server 2010 : Deploying Unified Messaging (part 2)
- Exchange Server 2010 : Deploying Unified Messaging (part 1)
- BizTalk Server 2009 : Types of services
- BizTalk Server 2009 : Identifying Standard Message Exchange Patterns (part 3)
- BizTalk Server 2009 : Identifying Standard Message Exchange Patterns (part 2) - One-way services
- BizTalk Server 2009 : Identifying Standard Message Exchange Patterns (part 1) - Request/Response services
- Exchange Server 2010 : Planning for Unified Messaging (part 3)
 
 
Most View
- SharePoint 2010: Create a Content Type
- SharePoint 2010 : Create a New Document
- Microsoft Dynamic GP 2010 : Installing Integration Manager (part 2) - SQL Server maintenance jobs
- Exchange Server 2010 : Unified Messaging - The Basics of Telephony
- Windows Server 2008 Server Core : Understanding Internal and External Commands
- Programming Windows Phone 7 : An XNA Program for the Phone (part 1)
- Installing Windows Small Business Server 2011 : Selecting Network Components (part 1) - Selecting an Internet Service Provider
- Windows 7 : Controlling Services at the Command Prompt
- CSS for Mobile Browsers : WebKit Extensions (part 1) - Text Stroke and Fill
- Windwos Server 2008 : Recovering from a Server or System Failure (part 3)
Top 10
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 3) - Configuring Recipient Filtering
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 2)
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 1)
- Implementing Edge Services for an Exchange Server 2007 Environment : Installing and Configuring the Edge Transport Server Components
- What's New in SharePoint 2013 (part 7) - BCS
- What's New in SharePoint 2013 (part 6) - SEARCH
- What's New in SharePoint 2013 (part 6) - WEB CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 5) - ENTERPRISE CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 4) - WORKFLOWS
- What's New in SharePoint 2013 (part 3) - REMOTE EVENTS