Pacific WebSpeed WebHandler based JSDO Generic Service
Starting the June 3rd 2016 release we support a WebHandler based generic service for JSDO based clients.
Configuration
WebHandler configuration from the openedge.properties file:
[smartpas.ROOT.WEB]
adapterEnabled=1
defaultCookieDomain=
defaultCookiePath=
defaultHandler=OpenEdge.Web.CompatibilityHandler
handler1=Consultingwerk.OERA.JsdoGenericService.WebHandler.CatalogWebHandler: /Catalog/{EntityName}
handler2=Consultingwerk.OERA.JsdoGenericService.WebHandler.CountWebHandler: /Resource/{EntityName}/count
handler3=Consultingwerk.OERA.JsdoGenericService.WebHandler.ResourceSubmitWebHandler: /Resource/{EntityName}/SubmitData
handler4=Consultingwerk.OERA.JsdoGenericService.WebHandler.InvokeMethodWebHandler: /Resource/{EntityName}/{MethodName}
handler5=Consultingwerk.OERA.JsdoGenericService.WebHandler.ResourceWebHandler: /Resource/{EntityName}
srvrAppMode=development
srvrDebug=1
wsRoot=/static/webspeedSettings from .restapplicationsettings file:
{
"RestServiceName": "web",
"RestServiceAddress": "\/Resource",
}
Sample requests
Samples based on CustomerBusinessEntity:
Retrieving the Catalog
http://localhost:8820/web/Catalog/Consultingwerk.SmartComponentsDemo.OERA.Sports2000.CustomerBusinessEntity
GetCount of Customers where SalesRep = "BBB"
http://localhost:8820/web/Resource/Consultingwerk.SmartComponentsDemo.OERA.Sports2000.CustomerBusinessEntity/count?filter=
{"ablFilter": "salesrep EQ 'BBB'"}
CRUD operation for Customer
http://localhost:8820/web/Resource/Consultingwerk.SmartComponentsDemo.OERA.Sports2000.CustomerBusinessEntity
Header:
Content-Type = application/json
Body:
{
"dsCustomer": {
"prods:hasChanges": true,
"eCustomer": [
{
"prods:id": "eCustomer147712",
"prods:rowState": "created",
"CustNum": 0,
"Country": "GER",
"Name": "Marko Rüterbories",
"Address": "Unter Käster 1-3",
"Address2": "",
"City": "Köln",
"State": "NRW",
"PostalCode": "50667",
"Contact": "Me",
"Phone": "+49 (160) 7008229",
"SalesRep": "BBB",
"CreditLimit": 100999,
"Balance": 0.0,
"Terms": "Net30",
"Discount": 45,
"Comments": "This customer is on credit hold.",
"Fax": "",
"EmailAddress": "marko.rueterbories@consultingwerk.de",
"Flags": "C",
"SmartRecordKey": "",
"SmartAttachments": true,
"SmartComments": false,
"SmartCopiedFrom": "",
"id": "1",
"seq": 1
}
],
"prods:before": {
"eCustomer": [
{
"prods:id": "eCustomer147712",
"prods:rowState": "created",
"CustNum": 0,
"Country": "",
"Name": "",
"Address": "",
"Address2": "",
"City": "",
"State": "",
"PostalCode": "",
"Contact": "",
"Phone": "",
"SalesRep": "",
"CreditLimit": 0.0,
"Balance": 0,
"Terms": "",
"Discount": 0,
"Comments": "",
"Fax": "",
"EmailAddress": "",
"Flags": "",
"SmartRecordKey": "",
"SmartAttachments": true,
"SmartComments": false,
"SmartCopiedFrom": "",
"id": "1",
"seq": 1
}
]
}
}
}InvokeMethod of CustomerBusinessEntity
http://localhost:8820/web/Resource/Consultingwerk.SmartComponentsDemo.OERA.Sports2000.CustomerBusinessEntity/TestMethodMobile42
Header:
Content-Type = application/json
Body:
{
"plcParameter" : {
"SerializedType": "Consultingwerk.CharacterHolder",
"Value": ""
}
}