2016-07-01 58 views
1

我有一個場景,我需要通過動態發送端口發送JSON。出於這個原因,我創建了帶有JSON編碼器的發送管道,並帶有選項 刪除外部信封= true。BizTalk Json編碼器和動態端口

我有與我的動態端口相關聯的管道,並且管道同時具有Xml彙編器和Json編碼器(我也試過沒有xml彙編器,結果是相同的)。

我的構造形狀請求消息具有下面的代碼:

varXml.LoadXml(
"<ns0:DataMigrationRequest xmlns:ns0=\"http://temp">"+ 
    "<ns0:DataSets>Local Products</ns0:DataSets>"+ 
    "<ns0:Country>Spain</ns0:Country>"+ 
    "</ns0:DataMigrationRequest>" 
); 

msgRequest = varXml; 

msgRequest(WCF.SuppressMessageBodyForHttpVerbs)="POST"; 
msgRequest(WCF.TransportClientCredentialType) = "None"; 
msgRequest(WCF.AlgorithmSuite) = "Default"; 
msgRequest(WCF.SecurityMode)="Transport"; 
msgRequest(WCF.HttpMethodAndUrl)[email protected]"POST"; 
msgRequest(BTS.IsDynamicSend) = true; 

msgRequest(WCF.BindingType)="customBinding"; 
msgRequest(WCF.Action)=""; 
msgRequest(WCF.BindingConfiguration)[email protected]"<binding name=""customBinding""><httpsTransport /></binding>"; 

msgRequest(WCF.EndpointBehaviorConfiguration) = @" 
<behavior name=""customBehavior""> 
    <CustomBehavior /> 
</behavior>"; 

Dynamic_Port(Microsoft.XLANGs.BaseTypes.Address) =  System.String.Format("https://localhost/temp"); 
Dynamic_Port(Microsoft.XLANGs.BaseTypes.TransportType)="WCF-Custom"; 

每次我試圖發送一個消息我得到的錯誤:

​​

如果我更換了動態端口通過一個靜態端口一切正常,我能夠按預期發送消息。它只是不起作用,我發送作爲一個動態。

肯定有東西丟失,任何人有任何提示可以幫助?

+0

哪個版本的BizTalk? – Dijkgraaf

+0

你是否也嘗試過使用管道中的XML彙編器?如果這是拋出錯誤,那麼這是一個問題。 – Dijkgraaf

+0

版本是BizTalk 2013 R2。只有在使用XML Assembler時,我纔沒有任何問題。 – Ricardo

回答

0

我認爲我想到了這個問題。看起來WCF-Custom只能使用XML消息,因此我用WCF-WebHttp替換。