“无法从传输连接中读取数据。”在Windows Mobile上

时间:2014-02-17 01:50:59

标签: xml wcf windows-mobile windows-mobile-5.0

我已经阅读了很多关于此的问题和答案,但我的问题似乎有所不同。我有一个传输少量xml数据的WCF服务,请参阅:http://msi-ecs.com.ph:8090/uom/UOMws.svc/xml/codes。我还有一个打算用于Windows Mobile 5.0的应用程序,它应该从服务中读取xml数据。

我有两种方法可以做到这一点。当我尝试时,错误落在第一行:

    Dim xmlReader As XmlReader = xmlReader.Create("http://msi-ecs.com.ph:8090/uom/UOMws.svc/xml/codes")
    Dim xDoc As XDocument = XDocument.Load(xmlReader)

当我尝试这个时,在第二行:

    Dim request As HttpWebRequest = WebRequest.Create("http://msi-ecs.com.ph:8090/uom/UOMws.svc/xml/codes")
    Using response As HttpWebResponse = request.GetResponse()
        Using responseStream As Stream = response.GetResponseStream()
            Using reader As StreamReader = New StreamReader(responseStream, System.Text.Encoding.UTF8)
                xml = reader.ReadToEnd()
            End Using
        End Using
    End Using

两者都出现了同样的错误,所以我真的很困惑流程的哪一部分会提交错误。

请帮助我,我已经在这个问题上待了很长时间了。非常感谢你。

0 个答案:

没有答案