The control server 30 is configured for detecting whether the Web service is accessible in the network server 40, reading configuration information of the Web service if the Web service is accessible, generating a simple object access protocol (SOAP) request according to the configuration information, sending the SOAP request to the network server 40 for process, collecting the response information of the network server 40, generating processing results in the format of an XML document, creating an instance (i.e., an object) of a user-defined class, assigning element values of the XML document to variables in the instance of the class, and returning values of the variables to the business server 20.
The configuration information includes a Web service address (i.e., the network server 40 that stores the Web service). When the Web service information such as the Web service address changes, only the configuration information of the Web service needs to be updated.
The user computers 10 are configured for users to send the service request to the business server 20. The embodiment can be illustrated by an example as follows. When the business server 20 receives the service request from the user computer 10, the business server 20 invokes the corresponding Web service from the network server 40, and transfers the service request to the control server 30. The control server 30 determines whether the Web service is accessible (i.e., whether the Web service identifier exist) in the network server 40, reads the configuration information of the Web service if the Web service is accessible, generates the simple object access protocol (SOAP) request according to the configuration information, and sends the SOAP request to the network server 40.
When the network server 40 receives the SOAP request, it invokes the Web service to process the SOAP request, and returns the response information to the control server 30. The control server 30 generates the XML document, creates the instance of the user-defined class, assigns the element values of the XML document to variables in the instance of the class, and returns the values of the variables to the business server 20. The business server 20 returns the values of the variables as the service results to the user computer 10.
The determining module 301 is configured (i.e., structured and arranged) for determining whether the Web service is accessible in the network server 40. The Web service can be invoked by the business server 20 when the user computer 10 sends the service request to the business server 20. The loading module 302 is configured for reading the configuration information of the Web service if the Web service is accessible. The configuration information includes the Web service address. The Web service address is the network server 40 that stores the Web service.
The SOAP request generation module 303 is configured for generating the SOAP request according to the configuration information, and sending the SOAP request to the network server 40 for process. The network server 40 used to process the SOAP request is determined by the Web service address in the configuration information of the Web service. When the network server 40 receives the SOAP request, the network server 40 invokes the Web service to process the SOAP request and returns the response information to the control server 30.
The response information processing module 304 is configured for collecting the response information of the network server 40, generating an XML document, creating an instance of the user-defined class, traversing the XML document, assigning the element values of the XML document to variables in the instance of the class, and returning the values of the variables to the business server 20.
In step S401, the business server 20 invokes the corresponding Web service from the network server 40 to process the service request, and transfers the service request to the control server 30.
In step S402, the determining module 301 determines whether the Web service is accessible in the network 40.
In step S403, the loading module 302 reads the configuration information of the Web service in the control server 30 if the Web service is accessible.
In step S404, the SOAP request generation module 303 generates the SOAP request according to the configuration information.
In step S405, the SOAP request generation module 303 sends the SOAP request to the network server 40 for processing. The network server 40 is determined by the Web service address in the configuration information. When the network server 40 receives the SOAP request, it invokes the Web service to process the SOAP request thereby yielding response information.
In step S406, the response information processing module 304 collects the response information of the network server 40.
In step S407, the response information processing module 304 generating processing results in the format of the XML document according to the response information.
In step S408, the response information processing module 304 creates the instance of the user-defined class, traverses the XML document, and assigns the element values of the XML document to the variables in the instance of the class.
In step S409, the response information processing module 304 returns the values of the variables to the business server 20.
If the Web service is not accessible, in step S410, the determining module 301 returns the Web service error information.
It should be emphasized that the above-described embodiments of the present invention, particularly, any “preferred” embodiments, are merely possible examples of implementations, merely set forth for a clear understanding of the principles of the invention. Many variations and modifications may be made to the above-described embodiment(s) of the invention without departing substantially from the spirit and principles of the invention. All such modifications and variations are intended to be included herein within the scope of this disclosure and the present invention and protected by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
200610200882.1 | Sep 2006 | CN | national |