我在使用.NET WSE SoapTcpTransport.GetInputChannel或更具體的SoapReceivers.Add來使用IPv6地址時遇到了問題,它使用封面下的GetInputChannel。由於這個星球上沒有其他人似乎有這個問題,我認爲我做錯了什麼。IPv6和SoapTcpTransport.GetInputChannel(WSE)
如果我使用IPv4地址和端口(soap.tcp://192.168.0.198:9063)創建SOAP輸入通道,那麼一切似乎都很好。當我爲相同的網絡適配器(soap.tcp:// [fe80 :: c450:7142:67f5:ad66%11]:9063)使用IPv6地址時,則SoapTcpTransport.GetInputChannel引發異常:「System.ArgumentException:WSE813:以下傳輸地址無法映射到本地網絡接口:soap.tcp:// [FE80:0000:0000:0000:C450:7142:67F5:AD66]:9063/..「
唯一區別兩者之間的區別在於Uri是使用IPv4或IPv6地址創建的。這兩個地址都響應ping。此行爲是兩個Microsoft.Web.Services2和3同我有一個MS單元測試再現問題:
[TestMethod]
public void ShouldConstructInputChannelWithIpv6Address_Selfcontained()
{
Uri via = new Uri("soap.tcp://[fe80::c450:7142:67f5:ad66%11]:9063");
EndpointReference receiveEndpoint = new EndpointReference(via);
SoapTcpTransport soapTransport = new SoapTcpTransport();
ISoapInputChannel inputChannel = soapTransport.GetInputChannel(receiveEndpoint, SoapChannelCapabilities.ActivelyListening);
inputChannel.Close();
Assert.IsTrue(true); // If it makes it this far without an exception, then that's progress.
}
我問這個same question on the MSDN forums。