如何连接到与Android WCF服务 [英] How to connect to a wcf Service with Android

查看:152
本文介绍了如何连接到与Android WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  如何消费与Android WCF服务

我正在寻找连接WCF与Android ..我是新使用WCF,仍然我还没有解决它尚未..我有,我必须把一些parametest后,我必须从服务的答覆链接..

I am searching connection wcf with android.. I am new using wcf and still I havent solved it yet .. I have a link that I must send some parametest and after I must get a reply from service..

其我的链接 http://107.15.85.19/LoginService.svc
并有功能CheckUserName(字符串EmailAddress的,字符串密码)

its my link http://107.15.85.19/LoginService.svc and there is function CheckUserName(string EmailAddress, string Password)

以及我怎样才能调用这个函数,并添加参数,并得到一些回应?

well how can I call this function and add parameters to it and get some response?

我看了很多文章和codeS,但我想不出解决它。这WCF SERVIS是不是我的。然后,我没有关于功能多的信息,命名空间等。

I read many articles and codes But I couldnt solve it. this wcf servis is not mine. Then I dont have much information about functions, namespaces etc.

推荐答案

您可能想要的阅读更多的例子这个职位,但总结:

You might want to read this post for more examples, but to summarize:

的WCF服务可以通过多种传输(例如命名管道,TCP,HTTP MSMQ)的各种方式被暴露,连接$ C $光盘(例如二进制,二进制烯codeD-XML,XML ,JSON)。的传输和编码结合在一起被称为绑定。 标准绑定这里记录。

WCF services can be exposed via a number of transports (e.g. Named Pipes, TCP, HTTP, MSMQ), encoded in a variety of ways (e.g. binary, binary-encoded-XML, XML, JSON). A transport and encoding combined together is known as a "binding". Standard bindings are documented here.

工作中你必须做的跟这个服务的金额取决于什么约束力服务提供商选择了(我不能因为你发布似乎并不活跃的网址告诉)。

The amount of work you'll have to do to talk to this service depends on what binding the service provider has chosen (I couldn't tell since the URL you posted doesn't seem to be active).

如果他们选择了一些简单的像basicHttpBinding的,的WebHttpBinding甚至WsHttpBinding的,那么你应该能够创造必要的XML / JSON与服务进行交互。

If they've chosen something simple like basicHttpBinding, WebHttpBinding or even WSHttpBinding, then you should be able to create the necessary XML / JSON to interact with the service.

请注意,由于这似乎是一个认证服务,服务提供商可以很好地要求你支持增强的安全基础设施,如WS-Security,WS-信托等。

Note that since this appears to be an authentication service, the service provider may well be requiring that you support enhanced security infrastructures such as WS-Security, WS-Trust, etc.

然而,如果服务提供者尚未启用中继对他们的服务(这将允许以下载服务的端点,绑定信息格式等的详细描述),并提供了关于他们的预期消息格式没有文档等等,那么你将不得不做了很多数据包嗅探和猜测的工作与他们的服务进行交互。

However, if the service provider hasn't enabled metadata on their service (which would allow you to download a detailed description of the service's endpoints, bindings, message formats, etc.), and provides no documentation on their expected message formats etc., then you're going to have to do quite a lot of packet sniffing and guess-work to interact with their service.

您可能还需要阅读一些这些职位,以了解如何从像Android这样的移动设备访问WCF服务:
http://fszlin.dymetis.com/post/2010/05/10/Comsuming-WCF-Services-With-Android.aspx
HTTP://sochinda.word$p$pss.com/2012/01/18/communication-between-wcf-service-and-android-client/
<一href=\"http://shashidotnet.word$p$pss.com/2011/12/05/android-ax-app-part-1set-up-the-intermediate-wcf-service/\" rel=\"nofollow\">http://shashidotnet.word$p$pss.com/2011/12/05/android-ax-app-part-1set-up-the-intermediate-wcf-service/

You might also want to read some of these posts in order to understand how to access WCF services from mobile devices like Android: http://fszlin.dymetis.com/post/2010/05/10/Comsuming-WCF-Services-With-Android.aspx http://sochinda.wordpress.com/2012/01/18/communication-between-wcf-service-and-android-client/ http://shashidotnet.wordpress.com/2011/12/05/android-ax-app-part-1set-up-the-intermediate-wcf-service/

但同样,你将有一个更容易的时间,如果你能以了解所需的传输编码绑定,消息格式,安全需求,让服务的元数据和/或文件等。

But, again, you'll have a MUCH easier time if you can get the service's metadata and/or documentation in order to understand the required transport-encoding bindings, message formats, security requirements, etc.

心连心。

这篇关于如何连接到与Android WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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