Android端能从IIS服务端获取文件或者上传文件吗?

cndn先森 2014-08-21 05:42:59
如题,Android端能从IIS服务端获取文件或者上传文件吗?
目前Android引用的IIS发布的Web Service。需要有上传和下载附件的功能,能请问这中间有没有不能跨越的问题?
还是Android上传文件必须要整合tomcat和IIS两个服务?能直接上传到IIS网站的目录下吗?


求指点迷津
...全文
669 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
terell 2015-07-25
  • 打赏
  • 举报
回复
不知道博主解决了问题没?遇到了类似的,我给IIS网站目录下上传文件时,报的是405.
cndn先森 2014-08-22
  • 打赏
  • 举报
回复
We are currently investigating what exactly causes that List to be empty, but have the suspicion that our server might use realm=... instead of realm="..." in the challenge header. Missing quotation marks might be the cause for this problem. We have to investigate further if that is indeed the case and if we can make it work. 他说他在后端解决了,坑爹啊。怎么解决的也不说。
cndn先森 2014-08-22
  • 打赏
  • 举报
回复
引用 4 楼 q1060013577 的回复:
[quote=引用 3 楼 u013472677 的回复:] android 调用webservice上传或下载文件可以的,之前项目中已用 发生http的401错误,应该还是IIS配置或webservice下 web.config 配置问题
我使用.net和java application都能上传成功,但是Android上不行。 您在Android上使用的是哪个包,HttpURLConnection还是HttpClient? 我在Android项目中用HttpURLConnection发送http的PUT请求时会发生java.io.ioexception:no authentication challenges found这种蛋疼的异常。 有木有上传文件的例子?[/quote] 不知道您是怎么解决的。 我在stackoverflow上看到这个帖子 http://stackoverflow.com/questions/11810447/httpurlconnection-worked-fine-in-android-2-x-but-not-in-4-1-no-authentication-c 分析出来是HttpURLConnection源码中getAuthorizationCredentials()抛出的异常 https://bitbucket.org/seandroid/libcore/src/6b27266a2856/luni/src/main/java/libcore/net/http/HttpURLConnectionImpl.java 然后这个异常引起的原因是HeaderParser.parseChallenges(..)返回的list为空。 https://bitbucket.org/seandroid/libcore/src/6b27266a2856/luni/src/main/java/libcore/net/http/HeaderParser.java HeaderParser.parseChallenges(..)返回的list为空是因为http请求时服务端返回的字段是 realm=... 而不是 realm="..." 。缺少一对引号。 这个有没有办法在服务端解决?
cndn先森 2014-08-22
  • 打赏
  • 举报
回复
引用 3 楼 u013472677 的回复:
android 调用webservice上传或下载文件可以的,之前项目中已用 发生http的401错误,应该还是IIS配置或webservice下 web.config 配置问题
我使用.net和java application都能上传成功,但是Android上不行。 您在Android上使用的是哪个包,HttpURLConnection还是HttpClient? 我在Android项目中用HttpURLConnection发送http的PUT请求时会发生java.io.ioexception:no authentication challenges found这种蛋疼的异常。 有木有上传文件的例子?
qcxl 2014-08-22
  • 打赏
  • 举报
回复
android 调用webservice上传或下载文件可以的,之前项目中已用 发生http的401错误,应该还是IIS配置或webservice下 web.config 配置问题
cndn先森 2014-08-22
  • 打赏
  • 举报
回复
引用 1 楼 a308981840 的回复:
调用Web Service 与客户端是什么系统是没有关系的
IIS的权限也都给了,我已经设置了IIS匿名访问了,我用.net和java application都可以上传文件。 但是另一个做Android端的团队,上传文件总是发生http的401错误,是http头的Authorization发生问题了?
S308981840 2014-08-21
  • 打赏
  • 举报
回复
调用Web Service 与客户端是什么系统是没有关系的

8,327

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 IIS
社区管理员
  • IIS
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧