Biztalk message properties visible across applications? - biztalk

I have an existing schemas assembly from an already deployed BizTalk application. This assembly contains a property schema containing some properties which are promoted from the message body.
The problem I am having is that I want to configure a send port in a different BizTalk application with a subscription based on the value of the promoted property from that assembly.
However, I can't use this property for filtering because it doesn't show up in the list of properties in the send port filters dialogue.
There seems to be some "blocking" going on - because I am trying to filter based on a schema which is defined in a different application.
Is there any way around this? Has anyone got any suggestions.

OK I worked out that you can do this by manually editing the bindings file and adding in your filter expression there.

Related

When to load settings table

I have a web app, using asp.net MVC Core, along with entity framework core. Part of this application has a simple setup table. This is just a table, which will only ever have one record, with a number of fields in, so the administrator can easily change how the web app works.
The setup table is loaded into a static "Settings" class, so anywhere in the application can read it (views and controllers)
What I want to know is when or how is the best place to load this. At the moment I'm loading it in Startup.Configure, after the routes have been set.
For the most part, this works fine. But if I add a field to the setup table, its impossible to migrate (I'm using code first). I get errors about invalid fields. Typically the errors look like this:
An error occurred while calling method 'BuildWebHost' on class 'Program'. Continuing without the application service provider. Error: One or more errors occurred. (Invalid column name 'EmailApiKey'.
Invalid column name 'EmailBaseUrl'.
Invalid column name 'EmailSenderAddress'.
Invalid column name 'EmailSenderDomain'.
Invalid column name 'EmailSenderName'.)
Unable to create an object of type 'ApplicationDbContext'. Add an implementation of 'IDesignTimeDbContextFactory<ApplicationDbContext>' to the project, or see https://go.microsoft.com/fwlink/?linkid=851728 for additional patterns supported at design time.
To get around this, I have to remove the code thats loading the setup table.
This makes me think this is not the best place/way to load settings (seeing as though it obstructs with database migrations).
So - is there a better way to do this? Essentially, I want to:
load a setup table once when app first started.
Have this accessable everywhere in the application (views and controllers).
If a user changes the setup, the static version should be automatically updated.
I would lazy-load the settings on first access rather than at application startup. An advantage is that if the lazy-load fails, you'll just try again next time it's accessed.
If a user changes the setup, the static version should be automatically updated.
You could cache it in the ASP.NET Cache or MemoryCache. You can set an expiration so that it will be refreshed periodically in case a user has made changes. Or if the settings are in a SQL Server database, you can use the SqlCacheDependency class.

BizTalk deployment - Binding Files not well imported into custom pipeline component

When I deploy my applications I notice a very strange behaviour – Not all binding files are imported as they should be while others are.
I'm using a custom pipeline component that promotes a set of properties to the context, some are defined at in the pipeline itself while others are defined in the BTS Admin console so we can define them in the binding files.
<ReceivePipelineData><Root xmlns:xsd="http://www.w3.org/2001/XMLSchema" … Components><Component Name="I.MMA.COMPONENT"><Properties ><Customer vt="8">CUSTOMER_NAME</Customer>< … etc.
This works fine for some of our applications, they are being well deployed and our values that are configured in the binding file are visible in the admin portal while other applications don’t show the same information and the strange part is that, when we generate the binding files for the failing applications, the values are in the binding file but not visible nor used by BTS.
I have this behavior on different machines, anybody got an idea what is going on?
I recently moved my pipeline component from one stage to another while I didn't update the Stage CategoryId and the values were ignored.
I've seen something similar and fixed it by manually re-entering the pipeline settings in the admin console. I suspect that if the binding file settings are not exactly what the console expects for the pipeline then it doesn't display them. So try re-entering the settings for the affected ports and update your binding files from that.

Calling a web/wcf service from orchestration: adding a generated item vs adding service reference

If I want to call a web service or wcf method from an orchestration, I can do it by either adding a service reference to the project or adding a generated item. What is the advantage of either approach - is there a best practice?
Steef -Jan Wiggers answers a similar question here
TL;DR - Always use the Generated Items wizard.
My 10c - Although the .xsd files imported by Add Service is added as a schema and set to BtsCompile, there are some limitations such as:
Add Service Reference will add the client proxy, which isn't needed in a BizTalk project (and which might 'tempt' your devs to do silly things like using this proxy from a Custom assembly)
Service Reference makes a mess of importing complicated WSDL (e.g. with Generics or dependencies on other Schemas), See Considerations when consuming Web Services
Using the Add Generated Items wizard does extra work for you:
Adds in a Port Type for accessing the service, already preconfigured for the correct message types. Note however that it adds the Port type to a dummy .odx - i.e. don't delete the odx until you've moved the Port type elsewhere.
Allow you to create the Send Port bindings at the same time.
One thing I would recommend with the Wizard, is to create a folder for the WCF reference and always import all the artifacts into the folder (i.e. don't do the usual separation of Schemas from Ports and leave the dummy .odx there as well). This way, if you need to regenerate the items, just delete everything in the folder and start again (sadly, the wizard doesn't have a Update Service Reference equivalent.
Also note that if you do move the generated Schemas and Port Types into a separate assembly, that you will need to change the type modifier access to Public (it is internal by default)

using both 837P Multiple and Single schema

I have one application which is using 837P Muliple achema.Now i have another application which needs to use 837P single schema.but how to use 837P Single schema.As both have same namespace and root node.so i cant use schema from that application also and i cant deploy my schema also.Is there any solution for this situation.
Don't believe this is possible... BT's EDI repository can only hold one schema for each document type.
This should be per Biztalk Application. It will match to the schema in your application; hence you should be able to have one application with multiple and another application with single - but not within the same application.

Object definition not updating when changes are made to object inside Web Service

I've made a change to an object (added a class attribute) inside a web service and published the service. On a separate project, updating the web service reference (in Visual Studio) yields no change, and the newly added attribute is nowhere to be found.
I've confirmed that the change has been correctly published and that the new attribute is not somehow hidden from the outside, by looking at the service contract in a browser. Also, deleting the reference and adding it again works, but it feels cumbersome to have to do it all the time a change has to be done.
Is this some configuration issue or just a feature I have to learn to live with?

Resources