connect to a local web service from the Windows Phone 8 emulator - Resolving the issues
- This article resolves the issues that come across when we try to consume a web Service from our Windows Phone 8 Emulator.
When you create a WCF web service in Visual Studio, by default the service is hosted in IIS Express and only accepts connections at https://localhost/. Apps that target Windows Phone OS 7.1 can connect to the development computer as localhost because the Windows Phone 7.1 emulator uses the network connection of the development computer. The Windows Phone 8 Emulator, however, configures itself as a separate device on the network. As a result, an app running on the Windows Phone 8 Emulator can’t connect to the development computer as localhost.
All the relevant Details about this can be found at the following link
But the Problem is that this solutions too gives problems and the emulator won't consume a web service, just yet,
but fortunately, one of our brilliant interns here at MIC Lahore, Saad Mahmood, has come up with a solution that can help resolve the isssues.
When you intend to consume a web service, you generally come across the following exception,
for a resolution,
- Create a firewall exception to allow World Wide Web Services (HTTP) through the firewall.
- From the Windows Start screen, search for Turn Windows features on or off. Click to run the program.
- In the Windows Features dialog box, expand .NET Framework 4.5 Advanced Services, then expand WCF Services.
- Under WCF Services, check the box next to HTTP Activation. Click OK to install this feature.
- On the Action page, select Allow the connection. Then click Next.
- On the Profile page, select Private and, if applicable, Domain. Do not select Public. Then click Next.
- On the Name page, type a name for the rule – for example, Local web service for testing. Then click Finish.
Everything goes fine here but the problem in windows phone 8 is this that consuming WCF is not that much charm in WP8
you do all steps but still you fail, here is the solution to the problem
When ever you use your ip address you consume WCF first register it .
CMD provides native command that can be used for registering the URL for cashing.
- Run CMD as administrator and type this command
- Netsh http add urlacl url = https://<your ip> : <port>/ user = everyone
- This will result in “Reservation successfully added”
You can Follow the steps in the Blog Post by Saad Mahmood on the following Link
Comments
Anonymous
April 14, 2013
A single command resolves the issue in real.Anonymous
April 15, 2013
works fine !Anonymous
April 15, 2013
worked!Anonymous
April 15, 2013
Sir , Thanks for giving solution, I've been following many articles for this purpose. It worked!Anonymous
April 15, 2013
can someone give me more assistance?Anonymous
April 15, 2013
Works for WP8 Emulator!Anonymous
April 15, 2013
Easy to apply and works perfectly fine.Anonymous
April 15, 2013
Zafar, what is that you are seeking please? You can drop an email directly to the mentioned personals or leave your issue in comment here. We'll be glad to be of any help.Anonymous
April 15, 2013
In Bounds error. I'm having.Anonymous
April 16, 2013
I was through this stage while resolving this issue. I fond in bounds error, it was due to my firewall settings. may be I am wrong but what I believe it that this must resolve your issue , GOTO Windows Firewall ---- > Advance Settings ----- > Windows Firewall properties Domain Profile --- > Inbound Connections ---- > Allow Private Profile ----> Inbound Connections ----- > Allow Press OK hope it resolves the issue regards,Anonymous
April 16, 2013
Better to include this information in the very reference blog as a note or helping material.Anonymous
April 27, 2013
Resolved , ThanksAnonymous
April 27, 2013
Good Style to resolve it.Anonymous
April 30, 2013
Keep it upAnonymous
June 09, 2013
Having ProblemAnonymous
June 11, 2013
I would love to know about your issue, kindly visit the blog , drop me an email with snapshot of regarding issue or describe the very issue here. regards,Anonymous
August 06, 2013
I am having issues , help me ASAP please.Anonymous
January 04, 2014
It works!!Anonymous
September 29, 2014
I am having issues again same exception was found :(