BizTalk Server deployment error: a porttype operation can only contain messagetypes or class types

  • Sandro Pereira
  • May 23, 2024
  • 3 min read

Welcome back to another blog post on this saga of Errors and Warnings, Causes, and Solutions. Sometimes, I think I’m a magnet for errors, or they feel sad because they are not documented, and think… let’s upset Sandro.

This week, while I was trying to deploy through Visual Studio one change on a new BizTalk Server project that I’m working on, I got the following list of errors:

Error: a porttype operation can only contain messagetypes or class types
path\<orchestration-name>.odx        

Error: cannot find symbol ‘<namespace>.Oracle_BIZTALK_Package.INSERT_ORDERS’
path\<orchestration-name>.odx        

Error: identifier ‘INSERT_ORDERSResponse’ does not exist in ‘<namespace>.Oracle_BIZTALK_Package’; are you missing an assembly reference?
path\<orchestration-name>.odx            

are you missing an assembly reference

Needless to say, this was not the first time I had published this solution, and the name of the orchestration presented by coincidence had not changed, which was even more curious.

📝 One-Minute Brief

BizTalk Server deployments can fail with the error “A PortType operation can only contain MessageTypes or Class types” when schema configuration changes go unnoticed. This article explains a real‑world scenario where modifying the Root Reference property of a multi‑operation schema for testing caused orchestration deployment errors. It walks through the root cause and shows how reverting the schema configuration resolves the issue quickly and safely.

Cause

In this ORACLE schema, I have two schema definitions: INSERT_ORDERS and INSERT_ORDERSResponse, which is quite normal. We often have a schema with several operations defined.

The reason I got this error was due to the fact that during the test phase, the solution was already built, at least part of it. I had the need to generate a dummy instance of the INSERT_ORDERS, and for that, I had the need to:

  • Open the schema in the Schema Editor.
  • Right-click on the <Schema> node and select properties.
  • In the Properties panel, set the Root Reference property to INSERT_ORDERS.
    • Note that by default, the value of this property is (Default)
Root Reference

After that, I successfully generated a dummy instance of the message type… but I forgot to roll back that Root Reference property to its default value (Default).

When you try to deploy the solution with the Root Reference changed, it typically returns an error similar to this.

Solution

Once again, the solution to this problem is quite simple. You just need to revert the Root Reference property to its default value: (Default). For that, you need to:

  • Once again, open the schema in the Schema Editor.
  • Right-click on the <Schema> node and select properties.
  • On the properties panel, on the Root Reference property, define it as (Default)
Root Reference

Now, if you try to deploy it, everything will work. At least those errors will disappear.

I hope you find this helpful! If you liked the content or found it useful and want to help me write more, you can buy (or help me buy) my son a Star Wars Lego! 

Buy me a Lego
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top