0

Possible Duplicate:
How to Consume WCF Service with Android

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..

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?

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.

Community
  • 1
  • 1
ertan2002
  • 1,458
  • 1
  • 32
  • 68

2 Answers2

3

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

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).

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.

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.

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.

HTH.

Community
  • 1
  • 1
Rich Turner
  • 10,800
  • 1
  • 51
  • 68
0

You are going to need a java REST client for you application. Here is a good one: http://lukencode.com/2010/04/27/calling-web-services-in-android-using-httpclient/

You also need to determine whether the WCF send data in the form of XML, JSON, or binary formats, and find a way to parse the data accordingly.

Once you have done all this call the function like this:

http://107.15.85.19/LoginService.svc/CheckUserName?EmailAddress=&Password=

Replace the text inside the <> with your email and password. Don't include the <> in the url.