OData 创建服务操作以将值返回到 iPad
我想要做的就是在我的 .net OData 解决方案中创建一个返回整数值的简单服务操作。与在 iPad 上相比,我将使用 OData Obj-c SDK 吸收这个整数值。这是到目前为止我的服务操作:
<WebGet()> _
Public Function GetWorkOrderNumber() As Integer
Return DomainModel.SystemOption.GetWorkOrderNo
End Function
当您从浏览器中点击它时,它会返回以下内容:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<GetWorkOrderNumber p1:type="Edm.Int32" xmlns:p1="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices">112</GetWorkOrderNumber>
当我尝试从 iPad 调用此操作时,我得到了整个响应值。我想要的只是值 112。有谁知道我做错了什么或需要更改吗?
提前致谢
All i want to do is create a simple Service Operation in my .net OData solution that returns an integer value. Than on the IPad I will suck this integer value up using the OData Obj-c SDK. Here is my service op so far:
<WebGet()> _
Public Function GetWorkOrderNumber() As Integer
Return DomainModel.SystemOption.GetWorkOrderNo
End Function
This returns the following when you hit it from the browser:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<GetWorkOrderNumber p1:type="Edm.Int32" xmlns:p1="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices">112</GetWorkOrderNumber>
When I try to call this operation from the IPad i get the entire response value. All I want is the value 112. Does anyone know what I'm doing wrong or need to change?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将
$Response content
附加到 URL。但是,是的,我认为代理类会提供更好的方法。我还在寻找。You can append
$Response content
to the URL. But yeah, I thought the proxy classes would give a better way. I'm still looking.