New issue
Advanced search Search tips

Issue 755995 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Factory: Support SOAP(WSDL) as shopfloor service.

Project Member Reported by hungte@chromium.org, Aug 16 2017

Issue description

Currently the shopfloor service must be XMLRPC, however partners running Windows may prefer to write service in SOAP since that's natively supported by VS.NET, even C#.

In comparison to asking partners write web service that they don't have good environment to developer with, it seems easier to provide a wrapper and support SOAP, even JSON RPC, in our factory server (both shopfloor/factory_server and umpire).

The python 'zeep' package seems like an easy solution that we can invoke it with same interface.
 

Comment 1 by yhong@chromium.org, Aug 18 2017

How about only provide a wrapper to support SOAP/JSONRPC in umpire but not factory_server?

Comment 2 by hungte@chromium.org, Aug 18 2017

actually adding that in factory_server is easier than umpire.
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/6874eb04a63e4a120d72215aa345be79c2a476b4

commit 6874eb04a63e4a120d72215aa345be79c2a476b4
Author: Hung-Te Lin <hungte@chromium.org>
Date: Sun Aug 20 22:50:49 2017

factory_server: Support JSON-RPC and WSDL/SOAP web services.

The Chrome OS Factory Shopfloor Service was defined to be using XML-RPC
protocol. However, partners using Windows servers usually prefer to
implement web services using VS.NET, which implies SOAP/WSDL.

This change adds wrappers so the manufacturing line may deploy JSON-RPC
or WSDL/SOAP web service as shopfloor service.

To use JSON-RPC, prefix a 'jsonrpc:' to the service URL.
To use WSDL, prefix a 'wsdl:' to the service URL.
WSDL is automatically used if the lower cased URL ends with 'wsdl'.

Additionally, describing the generic compound type in WSDL may be not
trivial in certain framework (also that we need 'dot' in key name,
although this is allowed in SOAP). An additional filter 'json:' is
created that it'll translate all function call arguments and return
value as JSON string, so WSDL can simply declare the parameters as
'string'. This is also helpful for XML-RPC implementations that do not
support 'nil' extension.

Examples:

  http://10.3.0.11  # A XML-RPC server.
  json:http://10.3.0.11  # A XML-RPC server with input/output in JSON.
  jsonrpc:http://10.3.0.11  # A JSON-RPC server.
  http://10.3.0.11/?wsdl  # A WSDL (SOAP) server.
  json:http://10.3.0.11/?wsdl  # A WSDL server with input/output in JSON.

BUG= chromium:755995 
TEST=make test; cros_docker.sh umpire test
     Also tried calling GetDeviceInfo via a mock shopfloor service.

Change-Id: I33cc12692cb614f6a1243c2868d16daf06de36b4
Reviewed-on: https://chromium-review.googlesource.com/616940
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/6874eb04a63e4a120d72215aa345be79c2a476b4/py/umpire/server/umpire_env.py
[modify] https://crrev.com/6874eb04a63e4a120d72215aa345be79c2a476b4/py/umpire/server/rpc_dut.py
[modify] https://crrev.com/6874eb04a63e4a120d72215aa345be79c2a476b4/py/shopfloor/factory_server.py
[add] https://crrev.com/6874eb04a63e4a120d72215aa345be79c2a476b4/py/utils/webservice_utils.py
[modify] https://crrev.com/6874eb04a63e4a120d72215aa345be79c2a476b4/py/shopfloor/README.md
[modify] https://crrev.com/6874eb04a63e4a120d72215aa345be79c2a476b4/setup/Dockerfile
[add] https://crrev.com/6874eb04a63e4a120d72215aa345be79c2a476b4/py/utils/webservice_utils_unittest.py

Comment 4 by hungte@chromium.org, Aug 22 2017

Status: Fixed (was: Started)
Project Member

Comment 5 by bugdroid1@chromium.org, Aug 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/663835069fb6d637907ddf975719425977b74f26

commit 663835069fb6d637907ddf975719425977b74f26
Author: Hung-Te Lin <hungte@chromium.org>
Date: Tue Aug 22 14:15:49 2017

utils: Fix CannotSendRequest when calling web service in different threads.

The HTTP transport library is usually not thread safe so we should
create proxy objects for each invocation of web service.

Also improved WSDL proxy performance by adding InMemoryCache.

BUG= chromium:755995 
TEST=make test

Change-Id: I0f7acca52942c60b8e8b6d33ed062773880e4916
Reviewed-on: https://chromium-review.googlesource.com/625645
Commit-Ready: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>

[modify] https://crrev.com/663835069fb6d637907ddf975719425977b74f26/py/utils/webservice_utils_unittest.py
[modify] https://crrev.com/663835069fb6d637907ddf975719425977b74f26/py/utils/webservice_utils.py

Comment 6 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment