如何使用以下详细信息在 iPhone 中调用 Rest Webservice

发布于 2024-10-02 17:17:54 字数 602 浏览 0 评论 0原文

我有一个支持 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

可爱咩 2024-10-09 17:17:54

好吧,终于认识自己了,

我的服务器支持的 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文