Store scenario
Current behavior
Service | Binding URI | Embedded HTTP Host | WebApp Host | Widget | Comments |
---|---|---|---|---|---|
Catalog | /Catalog | dojo.rpc.JsonService("/Catalog?smd"); |
| ||
ShoppingCart/Cart | /ShoppingCart/Cart | tuscany.AtomService("/ShoppingCart/Cart"); |
| ||
ShoppingCart/Total | /ShoppingCart/Total | http://localhost:8080/sample-store-webapp/ShoppingCart/Total | dojo.rpc.JsonService("/ShoppingCart/Total?smd"); |
|
My understanding of URI behaviour is that a web page or javascript have no knowledge of context root or anything other then :
- "URI" -> points to a URI relative to the current location (e.g if http://localhost:8080/..../store.html" has a reference to "Catalog", it expects catalog to be in the same level as it is http://localhost:8080/..../Catalog)
- "/URI" -> points to a URI relative to server root (e.g if http://localhost:8080/..../store.html" has a reference to "/Catalog", it expects catalog to be in the same level as it is http://localhost:8080/Catalog)
Binding | Binding URI | Embedded HTTP Host | WebApp Host | Widget | Comments |
---|---|---|---|---|---|
<binding.xyz /> |
|
|
|
| no @uri |
<binding.xyz uri="http://example.com/ABC"/> |
|
|
|
| absolute @uri |
<binding.xyz uri="ABC"/> |
|
| relative URI NOT starting with / | ||
<binding.xyz uri="/ABC"/> | /ABC |
|
| relative URI starting with / |
My expectation regarding widget
- The widget should be agnostic to where it's running, and based on the binding configuration point to the proper service endpoint necessary to access the service
The current issues
- Binding uri is pointing to /Catalog, but when widget client javascript proxy tries to access /Catalog?smd service endpoint it fails as the webapp host changed the service endpoint to contextRoot/Catalog