【发布时间】:2015-03-04 17:41:58
【问题描述】:
在我的 IOS 应用程序中,我需要将图像发送到 ASP.NET Web 服务。我正在尝试以字节形式获取图像,然后将其转换回服务器端的图像形式。 现在我正在使用这些行将图像转换为 IOS 中的字节:
NSData *imageData=UIImagePNGRepresentation([Mybutton currentBackgroundImage]);
这一行给出了734,775字的字节,太多了,所以不能发送soap请求。 那么,现在我该如何实现这个目标??????
当使用soap请求调用服务时,它给了我这个错误:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body><soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring> System.Web.Services.Protocols.SoapException:
There was an exception running the extensions specified in the config file. ---> System.Web.HttpException: Maximum request length exceeded.
at System.Web.HttpRequest.GetEntireRawContent()
at System.Web.HttpRequest.get_InputStream()
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
--- End of inner exception stack trace ---
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
我正在制作一个聊天应用程序,所以在注册用户时,我必须将用户图像上传到网络服务器,当它搜索他/她周围的人时,我还想从网络服务返回 imae 我该怎么做这两件事? 首先将图像放在网络服务器上,然后从网络服务器检索。 非常感谢
【问题讨论】:
-
嗨,您找到问题的解决方案了吗?如果是这样,请帮助我解决这个问题。 stackoverflow.com/questions/29077775/…
-
@pasha pash - 我也面临同样的问题,下面的答案是我为解决问题所做的。如果您的问题仍未解决,请随时与我联系
标签: ios asp.net web-services soap