2014-02-25 2 views
3

C#을 사용하여 수신 포트를 구성했습니다. 아래 코드는 모든 것이 좋습니다. 하지만 인증 탭을 구성하고 USERNAME 및 PASSWORD의 세부 정보를 제공해야합니다. 아무도 이것에 대해 안내 할 수 있습니까?BizTalk 수신 위치 C#

수신 포트 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 

답변

1

인증은 사용자 지정 이름과 암호의 두 요소가 포함 된 XML CustomProps가 포함 된 속성 데이터에 보관됩니다.

주 : 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>