小编Ker*_*ern的帖子

mvvmcross expandablelistview

我只是想知道ExpandableListViews的功能或类似功能是否潜伏在Mvvmmcross框架内,或者这种类型的控件是否适用于多平台要求.在http://deapsquatter.blogspot.com/2013/02/mvvmcrossdeapextensions.html上找到的功能 很酷但不确定是否有可用的扩展/折叠功能.

任何指针/示例代码将不胜感激

expandablelistview mvvmcross

9
推荐指数
2
解决办法
3792
查看次数

WCF Rest Webservice with stream

我感兴趣地阅读了以下帖子,因为它是我遇到的问题的完全复制品(并且让我疯狂)"对于操作中的请求,UploadFile是一个流,操作必须有一个类型为Stream的参数." - http://social.msdn.microsoft.com/Forums/en/wcf/thread/80cd26eb-b7a6-4db6-9e6e-ba65b3095267

我几乎遵循了我找到的所有代码/示例,但仍无法解决此错误 - http://blogs.msdn.com/b/carlosfigueira/archive/2008/04/17/wcf-raw-programming-model -接收-任意data.aspx

我想要实现的是使用标准的文件名/流参数从Android设备发布一个图像(jpeg/png).很可能它是一个简单的东西我错误配置,误解或遗漏但我需要有一个概念证明的解决方案.

 public interface IConXServer
    {
    [OperationContract]
    [WebInvoke(UriTemplate = "UploadImage({fileName})", Method="POST")]
    void UploadImage(string fileName, Stream imageStream);
    }

 public class ConXWCFServer : IConXServer
    {
    public void UploadImage(string fileName, Stream imageStream)
       {
       //implement image save
       }
    }
Run Code Online (Sandbox Code Playgroud)

web.config设置 - >

<standardEndpoints>
   <webHttpEndpoint>
       <standardEndpoint name="webHttpEndpoint" helpEnabled="false"/>
   </webHttpEndpoint>
</standardEndpoints>

<bindings>
    <webHttpBinding>
        <binding name="webHttpBinding" transferMode="Streamed"/>
    </webHttpBinding>
</bindings>

<behaviors>
    <endpointBehaviors>
        <behavior name="webHttpBehavior">
            <webHttp/>
        </behavior>
    </endpointBehaviors> 
    <serviceBehaviors>
        <behavior>
            <serviceMetadata httpGetEnabled="false"/>
            <serviceDebug includeExceptionDetailInFaults="true"/>
            <serviceThrottling maxConcurrentCalls="2147483647"  maxConcurrentSessions="2147483647"/>
        </behavior>
    </serviceBehaviors>
</behaviors>
Run Code Online (Sandbox Code Playgroud)

使用vs2010和IIS …

rest wcf stream

8
推荐指数
1
解决办法
9959
查看次数

android post gzip

尝试在Android项目上实现gzip以减少客户端数据费用.所有设备都连接到WCF Web服务,IIS现在正按预期将压缩数据发送回设备.现在我需要弄清楚如何回发在Android设备上修改的gzip压缩xml数据.设备代码如下

     httpsURLConnection.setDoInput(true);
     httpsURLConnection.setDoOutput(true);
     httpsURLConnection.setConnectTimeout(TIMEOUT);
     httpsURLConnection.setReadTimeout(TIMEOUT);
     httpsURLConnection.setRequestMethod("POST");
     httpsURLConnection.setRequestProperty("Content-Type", "application/xml");
     httpsURLConnection.setRequestProperty("Content-Encoding", "gzip);
     httpsURLConnection.connect();

     GZIPOutputStream gzipOutputStream = new GZIPOutputStream(new BufferedOutputStream((httpsURLConnection.getOutputStream())));
     gzipOutputStream.write(_xmlText.getBytes());
     gzipOutputStream.flush();
     gzipOutputStream.finish();
     gzipOutputStream.close();
Run Code Online (Sandbox Code Playgroud)

在Web服务器上运行Wireshark会显示gzip数据包并对其进行解压缩以显示设备中的正确数据.问题是WCF Web服务似乎无法识别数据 - 错误是XmlException - 根级别的数据无效.第1行,第1位.这让我觉得数据仍然被压缩,WCF无法处理gzip - 我似乎记得以前读过的.那么我是否需要在.net中创建一个消息解码器来处理gzip压缩?希望在.net 4.5中解决这个问题吗?

对这些问题的任何帮助表示赞赏

wcf android gzip

6
推荐指数
0
解决办法
600
查看次数

标签 统计

wcf ×2

android ×1

expandablelistview ×1

gzip ×1

mvvmcross ×1

rest ×1

stream ×1