June 22, 2012 at 2:40 PM

For a recent project I needed to create and modify the party settings for a specific party through code.

All the ‘basic’ settings like UNA/UNB/Validation/… where rather easy to configure and are pretty straight forward.

However when wanting to configure the UNG segment, we ran into some issues.

 

But first things first, let’s create a new Party

image

 

To modify the EDI properties through code you need to initialize/load a Partner profile as shown below

image

 

When you loaded/created the Partner profile it’s rather straight forward to modify the basic Party Settings.

image

 

The real problem started when we had to create a UNG segment trough code.
To create a UNG you need to create a PartnerEdifactReceiverGroupUpdatable object and add it to the EdifactReceiver as shown below:

image

 

The actual problem here is that the PartnerEdifactReceiverGroupUpdatable class has no constructors defined. Also extending the base class

or implementing the interface did not give us the desired result.

 

After some investigation we ran into the GetUninitializedObject method from the FormatterServices class (http://msdn.microsoft.com/en-us/library/system.runtime.serialization.formatterservices.getuninitializedobject.aspx).

This method will create a new object of a class without calling the constructor, that way we initialized a new instance of PartnerEdifactReceiverGroupUpdatable and managed to create the UNG segment as show below.

 

image

 

Enjoy!

 

Glenn Colpaert

Posted in: BizTalk | EDI/AS2 | General

Tags:


June 7, 2012 at 5:47 PM

After years of publishing BizTalk WCF-Services and countless hours spend configuring the services in the wizard I just recently found out the WCF-Publishing Wizard can be started with a configuration file provided.

Actually the configuration file is generated after you published your service for the first time.

The configuration file ‘WcfServiceDescription.xml” is located in the App_Data/Temp subfolder in the folder where the service has been published:

clip_image002

 

To start the wizard with a configuration file, fire up a command prompt (using Administrative privileges). Start the wizard with the /WcfServiceDescription option and provide the configuration file:

clip_image004

 

In the “Create WCF Service” page of the wizard select the correct option:

clip_image005

 

The page that describes your service will have all information from your previous configuration:

clip_image006

 

As always there is one caveat:

The target namespace of the service is reset to the default and needs to be configured:

clip_image007

 

This definitely took the pain out of updating my services …

Posted in: BizTalk | WCF

Tags: