Biztalk получает местоположение в С#

Я настроил порт приема с помощью С#. Ниже приведен код, и все в порядке. Но мне нужно настроить вкладку аутентификации и предоставить данные ИМЯ ПОЛЬЗОВАТЕЛЯ и ПАРОЛЬ. Может ли кто-нибудь помочь мне в этом.

ReceivePort myreceivePort = app.AddNewReceivePort(false);

        //Note that if you dont set the name property for the receieve port, 
        //it will create a new receive location and add it to the receive       //port.
        myreceivePort.Name = "MyPort";


        //Create a new receive location and add it to the receive port
        ReceiveLocation myreceiveLocation = myreceivePort.AddNewReceiveLocation();


        foreach(ReceiveHandler handler in root.ReceiveHandlers)
        {
           if(handler.TransportType.Name == "FILE")
           {
              myreceiveLocation.ReceiveHandler = handler;
              break;
           }
        }

        //Associate a transport protocol and URI with the receive location.
        foreach (ProtocolType protocol in root.ProtocolTypes)
        {
           if(protocol.Name == "FILE")
           {
              myreceiveLocation.TransportType =  protocol;

              break;
           }
        }
        myreceiveLocation.CustomData
        // new BizTalk application

        myreceiveLocation.Address = "C:\\test\\*.txt";
        //Assign the first receive pipeline found to process the message.
        foreach(Pipeline pipeline in root.Pipelines)
        {
           if(pipeline.Type == PipelineType.Receive)
           {
              myreceiveLocation.ReceivePipeline = pipeline;
              break;
           }
        }

        //Enable the receive location.
        myreceiveLocation.Enable = true;
        myreceiveLocation.FragmentMessages = Fragmentation.Yes;//optional property
        myreceiveLocation.ServiceWindowEnabled = false; //optional pr

person user2979719    schedule 25.02.2014    source источник


Ответы (1)


Аутентификация проводится в свойстве Data, которое содержит XML CustomProps, содержащее два элемента Username и Password.

Примечание: 1) пароль тоже придется поменять

<Password vt=\"8\">PASSWORD</Password>

2) Добавлены разрывы строк для удобства чтения.

<CustomProps>
   <FileMask vt=\"8\">*.xml</FileMask>
   <RemoveReceivedFileMaxInterval vt=\"19\">300000</RemoveReceivedFileMaxInterval>
    <Username vt=\"8\">USER</Username>
    <RemoveReceivedFileRetryCount vt=\"19\">5</RemoveReceivedFileRetryCount>
    <RenameReceivedFiles vt=\"11\">0</RenameReceivedFiles>
    <RemoveReceivedFileDelay vt=\"19\">10</RemoveReceivedFileDelay>
    <FileNetFailRetryCount vt=\"19\">5</FileNetFailRetryCount>
    <Password vt=\"1\" />
    <PollingInterval vt=\"19\">60000</PollingInterval>
    <BatchSize vt=\"19\">20</BatchSize>
    <FileNetFailRetryInt vt=\"19\">5</FileNetFailRetryInt>
    <BatchSizeInBytes vt=\"19\">102400</BatchSizeInBytes>
</CustomProps>
person Dijkgraaf    schedule 26.02.2014