1

Closed

GenerateApplicationBindings fails for direct bound orchestrations

description

A NullReferenceException is thrown at
   at Microsoft.BizTalk.Deployment.Binding.ServiceRef.get_EndpointInfo()
   at Microsoft.BizTalk.Deployment.Binding.ModuleRef.get_EndpointInfo()
   at Microsoft.BizTalk.Deployment.Binding.BindingInfo.get_EndpointInfo()
   at Microsoft.BizTalk.Deployment.Binding.BindingInfo.get_BindingStatus()
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write46_BindingInfo(String n, String ns, BindingInfo o, Boolean isNullable, Boolean needType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write100_BindingInfo(Object o)
The following code should fix the issue
protected internal virtual ServiceRef CreateServiceRef(IOrchestrationBinding orchestrationBinding)
{
    // see https://msdn.microsoft.com/en-us/library/microsoft.biztalk.deployment.binding.serviceref.aspx
    var serviceRef = new ServiceRef {
        Description = orchestrationBinding.Description,
        // TODO EndpointInfo = 
        Host = new HostRef {
            Name = orchestrationBinding.Host,
            // TODO NTGroupName = "",
            // TODO Trusted = false,
            // TODO Type = (int) HostType.InProcess
        },
        Name = orchestrationBinding.Type.FullName,
        // TODO allow to change State
        State = ServiceRef.ServiceRefState.Enlisted,
        // TODO allow to change TackingOption
        TrackingOption = OrchestrationTrackingTypes.None
    };
    // ensure service ref port collection is initialized
    var serviceRefPorts = serviceRef.Ports;
    foreach (var portBinding in orchestrationBinding.PortBindings)
    {
        serviceRefPorts.Add(CreateServicePortRef(portBinding));
    }
    // TODO Roles = 
    return serviceRef;
}
Closed Dec 24, 2015 at 4:23 PM by fchabot

comments