【发布时间】:2009-07-22 12:49:34
【问题描述】:
我在获取 IPv6 地址以与 .NET WSE SoapTcpTransport.GetInputChannel 或更具体地说是 SoapReceivers.Add 一起工作时遇到问题,它在后台使用 GetInputChannel。由于地球上似乎没有其他人遇到这个问题,我认为我做错了什么。
如果我使用 IPv4 地址和端口 (soap.tcp://192.168.0.198:9063) 创建 SOAP 输入通道,那么一切似乎都很好。当我将 IPv6 地址用于同一个网络适配器时(soap.tcp://[fe80::c450:7142:67f5:ad66%11]:9063),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。
【问题讨论】: