Solution: Ajax polls cross-origin WebService.

Source: Internet
Author: User

Currently, there are several workflow systems. Each system provides a query of the number of jobs through WebService.

The number of jobs can be completed in the following ways.

That is to say, each WebService has at least three functions provided externally (the function signatures of all systems are consistent ).

Requirements:

In the. NET (2.0) Environment, write a web control or webpart to display the number of jobs of each system in a centralized manner.

The layout is as follows:


Note: the green part indicates the system and work item type with the current focus.

The three small boxes on the left show the work item type, and the small boxes on the top show the system.

Red text in the work item type on the left, displayedAll systemsInThe total number andFor example, if (23) is run, the sum of all systems (5 + 7 + 11 + 0) is used. To-Do, the same has been done.

The red text in the system on the right showsNumber of work items of the current system under the current type (that is, the type with the current focus on the left). For example, system 2 (7) indicates that system 2 has 7 tasks and System 3 has 11 tasks. When you click to switch the work type on the left, the number of all systems on the right also changes. For example, when you click to-do, the number of all systems on the right is the number of to-do lists owned by each system. The switchover interface is as follows:


Action Description:

When the widget is loaded, the first system and the first work item type are selected by default ).

When you click the work item type on the left, the number of systems on the right changes accordingly and the list is updated.

Click a system to update the list.

Technical Selection:

1.. Net: httpwebrequest

2. javascript: Ajax

Note:

1. When a system's server stops providing services or the server's response is slow, the control or component cannot block the page response.

2. The website of all WebServices and controls or components is not a domain (that is, all requests are cross-domain ). In addition, the WebService is not in the same domain either.

----------------------

Currently, I have processed HTTP webrequest and JS respectively. The following problems exist:

When httpwebrequest is used, when a webserivce stops responding or the response is slow, the page using controls or components is blocked.

Cross-origin issues may occur when Ajax is used.

Therefore, send this requirement and problems to us. Please help us solve them ..

Related Article

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.