如何使用以下详细信息在 iPhone 中调用 Rest Webservice
我有一个支持 REST WebService
https://xxx.yyy.zzz/abc/xyz.svc 的 URL (添加了一些屏蔽)
支持以下操作:
获取
创建
更新
getList
$metadata
支持以下选项:
$top(-1 获取所有记录)
$select
$filter(仅 '支持 eq' 和 'and' 运算符)
现在我需要在 iPhone 中测试上述操作。 对于简单的 SOAP 请求,我们创建 NSURLRequest 并设置所有参数,但是这里的事情很混乱,不知道如何使用上面的操作和选项。
如果有人知道一些信息请分享
谢谢
I have a URL which supports REST WebService
https://xxx.yyy.zzz/abc/xyz.svc (added some masking)
the following operations are supported:
Get
Create
Update
getList
$metadata
the following options are supported:
$top (-1 get’s all records)
$select
$filter (only the ‘eq’ and the ‘and’ operators are supported)
Now i need to test the above Operation in iPhone.
For Simple SOAP Request we creat NSURLRequest and set all parameters , but here things are confusing, dont know how to use these above Operations and Options.
If anyone know some info please share
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,终于认识自己了,
我的服务器支持的 Get、Create、Update 和 getList 等操作可以通过以下方式使用
https://xxx.yyy.zzz/abc/xyz.svc/Get< /strong>
这里的 Get 可以替换为 Create、Update 和 getList。
此 URL 需要在没有标头字段的 NSURLConnection 中使用。您可能会收到需要解析的 XML/JSON 响应。
现在的选项
https://xxx.yyy.zzz/abc/xyz.svc/get ()?$filter=spras eq 'D' and land1 eq 'AI'
这里我使用 $filter 选项,所以 get 变成 get()
我仍然不确定 spras 和 land1 是什么,我仍在研究这个,一旦完成实施我将分享更多信息。
如果其他人有更多信息,请分享。
此链接提供了一个很好的起点。选择任何公共 OData 服务并查看示例并在创建查询后观察链接。
谢谢
Ok finally got to know myself,
The Operations like Get, Create , Update and getList which are supported by my server can be used the following way
https://xxx.yyy.zzz/abc/xyz.svc/Get
Here Get can be replaced with Create, Update and getList.
This URL need to be used in your NSURLConnection with no Header Fields. You may get the response as XML/JSON which needs to be parsed.
Now for the Options
https://xxx.yyy.zzz/abc/xyz.svc/get()?$filter=spras eq 'D' and land1 eq 'AI'
Here i am using the $filter option , so get becomes get()
I am still not sure on what spras and land1, i am still working on this, i will share more info once i complete the implementation.
If others have more info please share.
This link provides a great place to start. Select any public OData Services and check out the examples and observe the link after you create you Query.
Thanks