InfoPath: Returning RichText from a WCF Service to a Form

I recently ran into an interesting one while building some InfoPath forms for SP2010/2013
forms services.

I wanted to return some Rich Text (XHTML) fields back from a WCF
WebService call.

I was at the point as a developer, where I couldn’t even say ’Works on my
machine
’.

The problem was – no matter what I tried, I would always have *plain text* and no
’richness’ of the Rich Text. Didn’t work for me.

So I have:

1) a basic WCF Web service – running on my dev environment.

2) an InfoPath Form that makes the call and displays the results.

The WCF Service:

This is the field that I eventually want to return as RichText to InfoPath.

Here’s the Service Method code (which basically goes into a file and returns back
a list of clauses) – just focus on the CONTENT = GetXHTMLRichText()

 

InfoPath and Returning a RichTextField
2 things need to happen for this to work.

1. When InfoPath adds the WCF Service to the form, it needs to ’detect’ the field
correctly when it build the underlying schema.

You need (nb – ’Content’ is my field name):
<xs:element minOccurs=”0″ name=”Content” nillable=”true”>
               
<xs:complexType mixed=’true’>
                   
<xs:sequence>
                       
<xs:any minOccurs=”0″ processContents=”lax” maxOccurs=”unbounded” namespace=”http://www.w3.org/1999/xhtml”></xs:any>
                   
</xs:sequence>
               
</xs:complexType>

</xs:element>

Note the namespace on the ANY element above – this is the winner to tell InfoPath
that this is a richtext field.

2. When returning data via this field (in my case the ’Content’ field),
it needs to be in a certain shape, as in:
<Content xmlns=http://yournamespace>
    <span xmlns="http://www.w3.org/1999/xhtml">Rich text here</div>
</Content>


Your rich text content needs to be ’wrapped’ for InfoPath to play nicely with it.

This was the purpose of my GetXMLRichText method as

 

The gotcha:

When I pointed InfoPath at my webservice and added a service reference I was getting
back a SimpleType for the field and not a ComplexType/Rich
Text field.

The WCF Service WSDL was ’almost there’ but not close enough:

The Content field described in a ComplexType which
is almost there, but not quite.

It’s missing the <xs:complexType mixed=’true’><xs:any namespace=’http://www.w3.org/1999/xhtml’ />.
The rest were good.

The fix:

Cutting a long story short, the simplest way forward here was to simply edit the form
components that InfoPath had built and correct the schema. Then reuse the form.

The form looks like this:

 

From the File->Publish->Export Source Files you can get to
the source and edit the correct schema (XSD) file.

Close the form down in InfoPath (or you may even need to close InfoPath) to edit the
Schema.

You may need to hunt through a few of them to find the right one. My file was GetKCCTerms12.xsd

Modify, save and close that file.

Right click on manifest.xsf -> Design to launch InfoPath and then
select Save As to work with it as *.XSN form (*.xsn files are just
CABs with all these files inside)

The final result as viewed from an InfoPath form – notice the bolding sent through.

Enjoy,

Mick.

Blog Post by: Mick Badran

Getting started with BizTalk Server 2010 R2 CTP in Windows Azure Virtual Machines

To get started, you need access to a Windows Azure subscription. If you don’t have one already, you can sign up for Windows Azure 90-day free trial here.

Create a Virtual Machine running BizTalk Server 2010 R2 CTP

To use this feature and other new Windows Azure capabilities, login to your account and sign up to use the preview features.

It’s easy to create a virtual machine that is running BizTalk Server 2010 R2 (CTP) when you use the Image Gallery in the Windows Azure Management Portal. This post will walk you through the steps involved to create a virtual machine running BizTalk Server 2010 R2 (CTP) in the cloud.

To learn more about Windows Azure and Virtual Machines, refer to this blog post.

Management Portal Experience

You use the From Gallery feature to create a custom virtual machine in the Management Portal. When you create this virtual machine, you can define the size of the virtual machine, the connected resources, the DNS name, and the network connectivity if needed.

  1. Sign in to the Windows Azure Management Portal.
  2. On the command bar, click New.
  3. Click Virtual Machine, and then click From Gallery.
  4. The VM OS Selection dialog box appears. You can now select an image from the Image Gallery.
  5. Click Platform Images, select the Microsoft BizTalk Server 2010 R2 CTP image, and then click the arrow to continue.

  1. The VM Configuration dialog box appears.
  2. In Virtual Machine Name, type the name that you want to use for the virtual machine. For this virtual machine, type MyBTSVM1.
  3. In New Password, type a password for the Administrator account on the virtual machine. For this virtual machine, type MyPassword1. In Confirm Password, retype the password.
  4. In Size, select the size of the virtual machine. The size that you select depends on the number of cores that are needed for your application. For this virtual machine, select Medium.
  5. Click the arrow to continue.
  6. The VM Mode dialog box appears.
  7. You can connect virtual machines together under a cloud service to provide robust applications, but for this tutorial, you are creating a single virtual machine. So, select Standalone Virtual Machine.
  8. A virtual machine that you create is contained in a cloud service. In DNS Name, type a name for the cloud service that is created for the virtual machine. The entry can contain from 3-24 lowercase letters and numbers. This value becomes part of the URI that is used to contact the cloud service that the virtual machine belongs to. For this virtual machine, type MyService1.
  9. Select the storage account for the VHD file. For this tutorial, select Use Automatically Generated Storage Account.
  10. In Region/Affinity Group/Virtual Network, select West US as the location of the virtual machine.
  11. Click the arrow to continue.
  12. The VM Options dialog box appears.
  13. The options on this page apply only if you are connecting this virtual machine to other virtual machines or if you are adding the virtual machine to a virtual network. For this virtual machine, you are not creating an availability set or connecting to a virtual network. Click the check mark to create the virtual machine.
  14. Windows Azure creates the virtual machine and configures the operating system settings. After Windows Azure creates the virtual machine, it is listed as Running in the Windows Azure Management Portal

 

How to log on to the virtual machine after you create it

You can log on to the virtual machine that you created to manage both its settings and the applications that are running on it.

1.      Sign in to the Windows Azure Management Portal.

2.      Click Virtual Machines, and then select the MyBTSVM1 virtual machine.

3.      On the command bar, click Connect.

4.      Click Open to use the remote desktop protocol file that was automatically created for the virtual machine.

5.      Click Connect.

6.      In the password box, type MyPassword1, and then click OK.

7.      Click Yes to verify the identity of the virtual machine.

You can now work with the virtual machine just like you would a server in your office.

Configure BizTalk Group

1.        Log into the machine using the steps mentioned above

2.      On first logon, a few start up tasks will be executed. Wait until the SQL Server – Getting Started link is created on desktop.

3.      The machine already has all the pre-requisites for running BizTalk Server from SQL Server to BizTalk Server installation to IIS configuration, etc.

4.      Launch BizTalk Configuration Wizard

5.      Use the basic or custom configuration and apply configuration Settings

6.      Once configured, you have a fully configured and running BizTalk Server environment in Windows Azure.

 

Next steps

The best way to get started with the offering is just to do some experimenting, developing and testing BizTalk Server 2010 R2 CTP on a Virtual Machine. This means you can deploy a Virtual Machine, perhaps as part of your new free trial and install BizTalk Server 2010 R2 CTP.

If you have any issues, problems, or questions, you can always find us on the help forums.

 

Blog Post by: BizTalk Blog

Announcing Microsoft BizTalk Server 2010 R2 CTP Release!

Today we are releasing a Community Technology Preview (CTP) of Microsoft BizTalk Server 2010 R2 to a limited number of our Technology Adoption Program (TAP) customers. We are also making the CTP available for preview to all customers as a predefined image in a Windows Azure Virtual Machine. BizTalk Server is Microsoft’s premier Integration and B2B communications server that enables organizations to connect disparate systems and business processes together.

In this CTP release, we provide a preview of brand new capabilities that bring together BizTalk on-premises and in the cloud via Windows Azure Virtual Machines to simplify building hybrid applications, drive increased productivity using the latest Microsoft platform (be it Windows Server, SQL Server, Visual Studio, etc.), better collaborate with their business partners using the improved B2B capabilities, and reduce operations cost with better manageability.

Here are the details:

Improved productivity with new Microsoft Platform support

Customers can now leverage the latest platforms and tools from Microsoft, such as Windows Server 2012 RC, SQL Server 2012, Visual Studio 2012 RC. All new BizTalk projects will target .Net Framework 4.5 RC by default. The CTP also provides support for the latest LOB versions enabling customers to use BizTalk for integrating their applications with the latest versions of SAP, Oracle and SQL Server.

The new adapters provide a seamless experience to enable hybrid connectivity, all done via configuration. The CTP provides native support for Windows Azure Active Directory Access Control (ACS) authentication and is extensible for other authentication mechanisms.

  • Platform support
    • Windows Server 2012 RC, Windows Server 2008 R2
    • SQL Server 2012, SQL Server 2008 R2
    • Visual Studio 2012 RC
    • Office 2010
    • Support for latest LOB versions
    • Support for SQL Server 2012
    • Support for SAP 7.2
    • Support for Oracle DB 11.2
    • Support for Oracle EBS 12.1 …
  • Adapters
    • WCF-WebHttp adapter, to consume REST service or expose REST service
    • SB-Messaging, for sending/pulling data from Service Bus Queues/Topics
    • WCF-NetTCPRelay, for hosting relays or sending data to NetTCPRelay end points
    • WCF-BasicHttpRelay, for hosting relays or sending data to BasicHttpRelay end points

Better B2B with schema updates

EDI standards evolve and one of the key investments made in this new BizTalk CTP is to ensure that we support the latest B2B standards natively. This enables you to transact messages based on the latest versions of EDI protocol.

  • B2B enhancements to support latest standards natively
    • Support for X12 5040, 5050, 6020, 6030
    • Support for EDIFACT D06A, D06B, D07A, D07B, D08A, D08B, D09A, D09B, D10A, D10B
    • HL7 2.5.1

We are working on further schema updates such as HL7 2.6, these will be enabled in the BizTalk 2010 R2 Beta.

Improved Performance

The CTP provides performance improvement for certain key scenarios. In case of two way MLLP adapter scenarios where ordered delivery is set, the tests have revealed up-to 5X performance improvement so far in our environments. We have also made enhancements in our engine to improve the performance in ordered send port scenarios.

Building hybrid applications

Today, there is an increase in the adoption of hybrid application scenarios where some components of an application run in the cloud while other components/LOB applications remain on-premises. The ability to integrate these components and leverage the richness of both worlds is growing in importance.

In this CTP release, we enable hybrid connectivity by providing first class support for integrating with Windows Azure Service Bus Queues/Topics/Relays. We are introducing the following adapters

  • SB-Messaging, for sending/pulling data from Service Bus Queues/Topics
  • WCF-NetTCPRelay, for hosting relays or sending data to NetTCPRelay end points
  • WCF-BasicHttpRelay, for hosting relays or sending data to BasicHttpRelay end points

Integrating with Windows Azure Service Bus entities is now just a few configurations away!

Integration with RESTful services

One of the other prevalent trends in the market today is the proliferation of RESTful services. Almost all new services, as well a lot of existing services, have a REST interface exposed. For example, all services in Windows Azure (e.g. Windows Azure Marketplace), Salesforce, etc. have support for REST services. With this CTP release, we are making it really easy for you to integrate RESTful services with BizTalk Server using the new WCF-WebHttp adapter. All the HTTP operations like GET, PUT, POST and DELETE are now supported natively. It gets better.

We initially planned for this feature to only support consuming REST services from BizTalk, however we received feedback from customers that there should be a way to expose REST services as well from BizTalk. We listened to your feedback and we are excited to announce that you now have an early preview to exposing REST services from BizTalk Server as well in this CTP.

BizTalk Server in Windows Azure Virtual Machines

Setting up a new BizTalk Server environment usually involves a long lead time to procure hardware, get the dependencies in place, set up the server, etc. This means long lead times before you can get started with your new BizTalk Server project. We are now leveraging the power of the cloud and the richness of Windows Azure to provide an experience where you can get up and running with your BizTalk Server environment in matter of minutes and move your existing applications to the cloud without making any changes. Furthermore, the CTP provides improvements to the BizTalk multi-machine configuration and now you can do this using some basic configuration settings with the click of a button in a single machine, without having to go and configure the BizTalk Server Group in each of the individual nodes.

In the coming months, we will broaden availability for interested customers to try the latest release of BizTalk Server prior to GA. For customers outside of the limited TAP program who want to try the CTP today, we have some great news. All the above enhancements are now available for you to preview with BizTalk Server in a Windows Azure Virtual Machine.

Resources to get started

  • If you are part of Microsoft BizTalk Server 2010 R2 TAP program, you can access our connect site and access resources, log bugs, provide feedback, etc.
  • To know more about BizTalk Server in Windows Azure Virtual Machines, please check our blog post titled “Announcing BizTalk Server 2010 R2 CTP availability in Windows Azure Virtual Machines”.
  • To provide feedback on BizTalk Server in Windows Azure Virtual Machines, please provide feedback in our MSDN forum.

Here are some links to recent sessions at TechEd North America and TechEd Europe Sessions where you can learn more about all the new features and the future of BizTalk Server:

  • TechEd North America
    • Application Integration Futures: The Road Map and What’s Next on Windows Azure
    • Building Integration Solutions using Microsoft BizTalk On-Premises and on Windows Azure
  • TechEd Europe
    • Application Integration Futures: The RoadMap and what’s next on Windows Azure

We are excited about this next version of BizTalk, and invite you to test out the CTP release and to give us your feedback on the new features.

The BizTalk Server Team

Blog Post by: BizTalk Blog

Three Months at a Cloud Startup: A Quick Assessment

Three Months at a Cloud Startup: A Quick Assessment

It’s been nearly three months since I switched gears and left enterprise IT for the rough and tumble world of software startups and cloud computing. What are some of the biggest things that I’ve observed since joining Tier 3 in June? Having a technology-oriented peer group is awesome. Even though we’re a relatively small company, […]
Blog Post by: Richard Seroter

Creating a BizTalk 2010 R2 CTP Azure VM

Published by: Bill Chesnut

Please Note: More Details will be available soon on the BizTalk Blog: http://blogs.msdn.com/b/biztalk_server_team_blog/

From the title I should have peeked your interest, yes the BizTalk 2010 R2 CTP has been released in Azure VM gallery as a Platform Image

So lets go through the process of creating an BizTalk 2010 R2 CTP Azure VM

First you will need an Azure Account and you will need to enable the Azure VM preview feature and be using the new Azure Portal

Click the NEW symbol in the lower left corner of the Azure Portal

Click Virtual Machine, then From Gallery

Select the Microsoft BizTalk Server 2010 R2 CTP and Click ->

Give the Virtual Machine a name, set the administrator password and choose the VM Size

Chose a DNS Name, Storage Account, Region and Subscription

Click the Check

on the virtual machine portal screen you will see

It may take several minutes for the provisioning to complete

Click on the virtual machine, the virtual machine screen will come up, Click the RESTART at the bottom of the Portal Screen

Once clicking restart, it seems to set at Running (Provisioning) for a long time

Once the machine is Started, Click the CONNECT

Then click Open

Then Click Connect

Then enter the Administrator password and click OK

Click Yes

Then the remote desktop session starts

When you logon, SQL should go through some configuration activities

I then created a local BizTalk account to use for the BizTalk Services

Add the BizTalk User to the local Administrators group

You then bring up the BizTalk configuration program

I am doing a basic configuration with the BizTalk service account I created before

Click Next

Wait for the configuration to complete

Once configuration completes, click Finish

Then close the configuration tool.

Open the HelloWorld sample directory

double click on the setup.bat file

Copy the SamplePOInput.xml into the In folder

Open the Out folder, and see the new file

Open the BizTalk Server Admin Console

Now that BizTalk is installed and tested you have all the tools to get starting building application in BizTalk 2010 R2 CTP, note the VS 2012 is the RC

More …

BizTalk BAM Archiving

Posted By: Bill Chesnut

There have been several previous blog posts by several different authors about BAM Archiving, I decided that it would be good if all of the information was in one article, so here I go.

To start off I have used information from Richard Seroter’s Blog post BizTalk BAM Data Archiving Explained which gives a good description of the BAM Archiving structure. What I found though was there was not any really good material on what I need to do to make the BAM archiving happen.

I started investigating and found that what I had thought was automatically happening, the running of the BAM SSIS package was not automatically happening, the only part of the BAM processing that happens automatically is the Real Time Aggregation (if you have SQL Enterprise Edition).

So now I need to figure out what I need to do to get BAM Archiving working on my current clients site. I found that I needed to go into SSIS and look at all the BAM SSIS packages that were deployed and then setup a SQL Agent job to run these, but thinking more about BAM, I was looking for a way to not have to create or update a SQL Agent job every time that a new BAM Activity was added or removed.

Below is a look at the BAM SSIS packages that are deployed in a typical BizTalk installation with EDI and the ESB Toolkit.

I also found that a list all the BAM Activities are in the BAMPrimaryImport Database

The bam_Metadata_Activities table also include the OnlineWindowTimeUnit and OnlineWindowTimeLength and if Archiving was enabled

So I had an idea, what about another SSIS package that reads the bam_Metadata_Activities table and then executes all the SSIS packages for the deployed BAM Activities, this way only the currently deployed BAM Activities packages would be run.

I created an SSIS package that used the Execute SL Task to return a row set with the name of all the BAM SSIS packages, it then passes the row set to a Foreach Loop that runs an Execute Package Task for each SSIS package found.

I then created an deployment for the SSIS package and deployed it to the BizTalk SQL Server

Once the package is deployed in SSIS you can right click on the package and run package or you can create a SQL Agent job to execute the SSIS on a regular schedule, that is what I choose to do

Create the Job and then add a step that executes the SSIS package

If necessary you can update the location where the BAMPrimaryImport and SSIS packages are stored

Then Create a schedule, I have chosen to run the archive once a week at 2:00am Sunday morning

You can then test the job, but right clicking on the Job and start job at step and wait for it to complete

Once the job has completed you can look at the contents of the BAMPrimaryImport table bam_Metadata_Partitions and see which tables have data to be archived, but the archive process will not start until the CreationTime of the row in the bam_Metadata_Partitions is older than the OnlineWindowTimeLength, so in my example archiving will not start until 27/02/2013, so I cannot stress enough how important it is to setup archiving when you install BizTalk.

This should be all the information that you need to setup BAM archiving.

You can download my SSIS package from http://www.biztalkbill.comhttp://biztalkbill.com/Default.aspx?id=15&tabid=60

More …

Multi-Part Message Attachments Zipper Pipeline Component for BizTalk 2006/2009 is now available

Multi-Part Message Attachments Zipper Pipeline Component for BizTalk 2006/2009 is now available

Two months ago I published on CodePlex and at Microsoft Code Gallery the pipeline component “Multi-part Message Attachments Zipper Pipeline Component” for BizTalk Server2010. This time I decided to make available a version of this component for previous version of BizTalk Server. The BizTalk Multi-Part Message Attachments Zipper is a pipeline component for BizTalk Server […]
Blog Post by: Sandro Pereira

Cloud-Burst 2012-Windows Azure Developer Conference in Sweden

The Sweden Windows Azure Group (SWAG) will running “Cloud-Burst 2012”, a two-day Windows Azure conference hosted at the Microsoft offices in Akalla, near Stockholm on the 27th and 28th September, with an Azure Hands-on Labs Day at AddSkills on the 29th September. The event is free to attend, and will be featuring presentations on the latest Azure technologies from Microsoft MVPs and evangelists. The following presentations will be delivered on the Thursday (27th) and Friday (29th):

%u00b7 Connecting Devices to Windows Azure – Windows Azure Technical Evangelist Brady Gaster

%u00b7 Grid Computing with 256 Windows Azure Worker Roles – Connected System Developer MVP Alan Smith

%u00b7 ’Warts and all’. The truth about Windows Azure development – BizTalk MVP Charles Young

%u00b7 Using Azure to Integrate Applications – BizTalk MVP Charles Young

%u00b7 Riding the Windows Azure Service Bus: Cross-’Anything’ Messaging – Windows Azure MVP & Regional Director Christian Weyer

%u00b7 Windows Azure, Identity & Access – and you – Developer Security MVP Dominick Baier

%u00b7 Brewing Beer with Windows Azure – Windows Azure MVP Maarten Balliauw

%u00b7 Architectural patterns for the cloud – Windows Azure MVP Maarten Balliauw

%u00b7 Windows Azure Web Sites and the Power of Continuous Delivery – Windows Azure MVP Magnus M%u00e5rtensson

%u00b7 Advanced SQL Azure – Analyze and Optimize Performance – Windows Azure MVP Nuno Godinho

%u00b7 Architect your SQL Azure Databases – Windows Azure MVP Nuno Godinho

There will be a chance to get your hands on the latest Azure bits and an Azure trial account at the Hands-on Labs Day on Saturday (29th) with Brady Gaster, Magnus M%u00e5rtensson and Alan Smith there to provide guidance, and some informal and entertaining presentations.

Attendance for the conference and Hands-on Labs Day is free, but please only register if you can make it, (and cancel if you cannot).

Cloud-Burst 2012 event details and registration is here: http://www.azureug.se/CloudBurst2012/

Registration for Sweden Windows Azure Group Stockholm is here: swagmembership.eventbrite.com

The event has been made possible by kind contributions from our sponsors, Knowit, AddSkills and Microsoft Sweden.

Monitor your BizTalk environment using PowerShell – Disk Space Monitoring

Monitor your BizTalk environment using PowerShell – Disk Space Monitoring

One of the principal needs for BizTalk Administrators is the ability to monitor the health of BizTalk environments and react promptly to possible problems, you can accomplished this by using certain tools such as: BizTalk Administration Console: is a Microsoft Management Console (MMC) that you can use to manage and monitor BizTalk Server, and that […]
Blog Post by: Sandro Pereira