wcf service and windows phone device - wcf

i'm developing a Windows phone 8 application which consume my wcf service.
Can i host my service locally on my laptop ( using iis express ) and use my phone consume the service?
I can connect to service from wp8 emulator, but it doesn't work when i deploy and test on my phone.

I believe this is a result from your consumed service on the emulator having a direct access to your localhost ip (127.0.0.1), but when you move the software to run on the device, it doesn't find the service in that IP anymore.
This page has a lot of information on the configuration of this matter and probably what you're looking for:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj684580%28v=vs.105%29.aspx

Related

Hosting WCF Service online for use from a Windows Phone 8 device

I can't seem to get my Windows Phone 8 app to successfully connect to my wcf service, and I'm wondering if it is because I haven't yet started paying to host the wcf service online. I can connect to the service when I use the WP8 emulator, but not when I load the app onto a device. Should the device be working or do you think it's because I am not yet hosting the service online?
Maybe that's because your wcf service is accessed through localhost when using the emulator.Then, your device has no access to localhost, if I'm not mistaken, which could explain why your device could not connect to the service.The way to solve this could be to host your service online, as you've already figured.

Windows Store Application unable to access localhost WCF service and throws EndpoingNotFoundException

I have a solution which basically contains three components:
• WCF Service that is hosted locally having a back-end SQL Server Express DB and this WCF service is hosted from a Windows Service
• A console application
• A Windows Store Application
This is what they are meant to do:
• WCF service his hosted locally and is used by the console app and the store app for communicating with the database
• The console app adds an image for processing to the database by contacting the WCF service
• The store app will at regular time look for unprocessed images in database via the WCF service and will process them
Now, the difficulty is:
• The WCF service is hosted successfully and is working absolutely fine and I can check that by hitting its URL http://localhost:8081/XYZ
• The console app is also able to submit images to the WCF service and add their local paths to the database
• The store app however always throws the EndpointNotFoundException when accessing the service at that same localhost path
What have I tried:
• I have tried almost everything from searching through stackoverflow to googling and haven't found a solution yet
• I was thinking that it might be a port issue and so I turned off the firewall to check this, but it did not work, and the store app kept throwing the EndpointNotFoundException
What have worked:
• The complete set-up has, however, worked perfectly on my machine. It is strange that its not working on my client's Windows 8 machine.
Point to be noted:
• The complete solution has been developed in Visual Studio 2013 and the App is for Windows 8.1
• I am not sure, but it seems my client has a Windows 8 machine and we are installing the app on that. (Possibly, that might be a problem. But I'll check)
If there is any help someone could provide me, I'll be really greatful. Thanks in advance!
This is expected. Windows Store apps cannot connect back to the local system in production. This loopback prohibition is disabled for debugging.
See How to enable loopback and troubleshoot network isolation
If your app is to be side-loaded rather than deployed through the store then see Using network loopback in side-loaded Windows Store apps

Access a Windows Azure WCF Services on a Windows Phone 7 Device on a local development machine

How do I access a Windows Azure WCF Services on a Windows Phone 7 Device on a local development machine. I've tried my local IP and also switched off my firewall. Nothing helps. Do we have any cool hacks for that?
Ok so you're trying to access the emulator on your development machine with a real Windows Phone device? Officially this isn't supported, since the emulator only accepts local connections. But you can use the port forwarding features available in Windows to bypass this limitation:
netsh interface portproxy add v4tov4 listenport=8081 connectport=81 connectaddress=127.0.0.1
Now, instead of having your WP7 connect to yourip:81 you should configure the device to connect to yourip:8081.

Windows Phone WCF EndpointNotFound Exception on device

I have a windows phone project communicating with a WCF service. All runs fine in the emulator but when I deploy to a device I get an endpoint not found exception with an inner exception of The server returned an error: not found.
This is on a new dev laptop I am setting up. All worked fine on the old laptop.
Any ideas?
Cheers
Steve
If you used the localhost for service change it to ip of the web service. When you run on emulator it understands the localhost because it runs on localhost but when you run on phone the phone has separate ip so it dose not understand localhost anymore.

WCF service problem with Windows XP client

I have a program for Windows Application with the Bank uses a WCF service.
Several Windows 7 client using this service are working well, one of the Windows XP client, and when the service is connected and started working, service to any of the other client does not respond; until Windows XP client relationship is discontinued.
Thanks and respect.