WP8 Everyone oversees app development-(pre-research > App planning > Code Authoring > Testing > Shelves to stores)

Source: Internet
Author: User

Objective

Always want to do something for the community, but have not known what to do, the long-planned "everyone supervision" app finally made a half.

Developed several apps, has not written blog record in the development of the application of the problems and technology, the "everyone supervision" can not be missed, we must insist on the entire development process written down, with you to share in the code world of Happiness.

"Everyone supervision" is a public complaint, prosecution, supervision of an app, its purpose is to supervise everyone to create a harmonious society!

Project Technology

Development environment: WINDOWS8 + Visual Studio + SQl Server 2008

Server side: EntityFramework6 + wcfservice

Client: WIndowsPhone8, 8.1

Framework: MVVM

Planning

In the notebook, handwritten, have time to copy down!

Development history

Functional modules that have been completed to the current location:

(In the Order of development)

1. The service side of the entire app

2. Client Information List display

3. List of provinces and cities

4. Issuance of whistleblowing supervision information (can upload images)

5. Login

6. Registration

Problems encountered

At first prepare to use ASHX (General processing program) to write the service side, the general processing program is very general.

Communicate with friends, found that the problem is far from the simple I imagined, there are too many issues to consider: such as the transport protocol with what, user information security, data encryption, server access rights and so on.

Consider the decision to use WCF over and over again, because there are only a few basic uses in the previous project.

Originally thought that WCF is just a very simple service similar to WebService, after starting to find that only WCF configuration is enough for you to ponder over a period of time.

We are programmers, not afraid, some brains, and repeatedly groping, found that the default configuration can be used by WP, alas.

The following lists the issues that you are experiencing:

1.WCF Configuration Issues

When using WCF, be sure to add an attribute for each operation for the client call to add [ServiceContract] on the interface, add [OperationContract] on the behavior, and an attribute [WebGet] if it is for a web call.

There is also the binding of WCF, the system-provided bindings and the introduction of the binding can be seen here http://msdn.microsoft.com/zh-cn/library/ms730879 (v=vs.110). aspx, At that time did not know how to search the key words, searched for long to find.

There is also a default binding for the property configuration http://msdn.microsoft.com/zh-cn/library/ms731361 (v=vs.110). aspx.

There are other problems have not been remembered, anyway, it was written a lot of demo, there are ASP, WPF, console, sliverlight of various tests, consulted the CSDN and MSDN forum, just fix.

There are also WCF exception processing still do not understand, in short, there is time must be the WCF system to look over.

2.WCF Boarding methods and access

I used IIS, after publishing to IIS, if the port is not 80, there will be frequent access to the situation. This is a good time to add an inbound rule to the firewall and allow access to the port. (Specific configuration time will be a separate blog post record: IIS Web site configuration port allows external device access)

3.WCF returns serialization of results

There is a virtual add-in in EF, some navigation properties cannot be serialized, and this time the deferred loaded object plus the DataContract and datamember features are OK, and the contract in WCF is also involved. (A separate blog post will be written: Wcfservice returns the serialization of the collection Object)

4.WCF of security

Everything is ready, the service is written, published to IIS, the client can reference the normal. But the problem comes again, once the server address leaks, then others can not be referenced by my WCF?

After some data query, see a few solutions, there are two kinds of I think is reliable, the first is the security certificate, the second is to write their own verification.

Security certificate That thing seems very advanced, I chose the second, compared to the latter, it would be easier to understand, that is, each time the server is requested to add a header information, in the header information with a user name and password.

After the Wcfservice server is judged, the mismatch throws a direct exception that you do not have access to. Compared

Although simple, but this is more cumbersome, to be in no way inside a judgment. (I'll study the security certificate later, I'll write a post after the study: a blog post on Wcfservice's security certification)

5. Image upload

Wcfservice receive WP8 pass the picture to save the time either denied access, or could not find the directory.  This can be: var path = AppDomain.CurrentDomain.BaseDirectory + "Images"; (There is time to write a separate blog post: WP8 upload images via Wcfservice)

Not to be continued ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.