Web服务(WCF / ASMX),具有LINQ-To-SQL对iPhone的可操作性 [英] Webservice (WCF / ASMX) with LINQ-To-SQL operability to the iPhone

查看:124
本文介绍了Web服务(WCF / ASMX),具有LINQ-To-SQL对iPhone的可操作性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASMX-Web服务并测试我是否可以通过web服务URL访问iPhone(使用json而不是soap)并且一切正常。困扰我的是,是否有可能交换对象而不是集合或原始数据类型?是否可以将LINQ-TO-SQL对象发送到iPhone并将其解析为定义正确类的对象?



因为我收到了{d:[ My_Project]}并将其包装成jsond - 对象。



示例: LINQ-To-SQL实体:客户(服务器端)



我看到的一个解决方案是创建一个额外的Object-Class,比如克隆Linq-To-SQL实体和定义Data Members等。这种方式,因为有很多教程建议你使用JavaScriptSerializer手动构建你的jason字符串,这是错误的方法,而不是让它自动序列化。有没有人以前那样做过并准备分享他们的经历?



我真的很感谢答案/解决方案。

I have an ASMX-Web Service and tested whether I can access the iPhone over the web wervice url (using json instead of soap) and everything worked. What bothers me is if there is any possibility to exchange objects than Collections or primitive data types? Is it possible to send LINQ-TO-SQL objects to the iPhone and parse it as an Object defining the right class?

Because I get responses like {d:["My_Project"]} and it's wrapped into a json "d"-object.

Example: LINQ-To-SQL Entity: Customer (server side)

The one solution I saw was to create an extra Object-Class, like cloning the Linq-To-SQL Entity and defining Data Members etc. Is this way to go, because there are dozens of tutorials which advices you to manually build your jason string with JavaScriptSerializer which is the wrong way to go than let it serializing automatically. Are there any people who did it that way before and are ready to share their experiences?

I'm really thankful for answers / solutions.

推荐答案

这篇关于Web服务(WCF / ASMX),具有LINQ-To-SQL对iPhone的可操作性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆