Things to note when deciding on values to use for whttp:location (xmlns:whttp="http://www.w3.org/ns/wsdl/http")
Submitted on June 20, 2008 - 20:08. Story : Level :
This KB gives you a few guidelines to for selecting whttp:locations for your operations. Please refer [1] to find out what a whttp:location is.
- Always have some constant at the start of the template. Axis2 uses this constant along with the HTTP method to dispatch the request to the correct operation. For e.g, do not use templates such as “{name}/{age}”, rather use “someConstant/{name}/{age}”
- Always have a constant between parameters in the path segment of the URL. For e.g, do not use templates such as “someConstant/{name}{age}” rather use “rxsomeConstant/{name}someSeparator{age}”.
- Choose the separator such that it will not appear in instance data. For e.g, do not use templates such as “someConstant/{name}abc{age}” rather use “someConstant/{name}/{age}”. Its more likely that “abc” will appear in instance data rather than “/”.
- Do not include optional parameters into the path segment, rather have them as query parameters. For e.g, if age is an optional parameter do not use a template such as “someConstant/{name}/{age}” rather use “someConstant/{name}” so that age will be in the query part of the URL.
- Do not expose two operations over the same HTTP method when they have the same constant part at the start of the template. For e.g, “someConstant/{foo}” and “someConstant/{bar}”. Do not expose the above operations over the same HTTP method. Either change the HTTP method or the constant.
Following these guidelines will ensure that the server is able to dispatch the request to the correct operation depending on the HTTP method and the request URL.
[1] http://wso2.org/library/3715
Author: Keith Chapmon, Senior Software Engineer, WSO2 Inc. keith at wso2 dot com
No votes yet
»
- Login or register to post comments
- Printer friendly version
- 267 reads
Tag Cloud
Apache
Apache Rampart
Apache Synapse
Axis2
Axis2
Axis2/C
Axis2/C
WSF/C
Rampart/C
data services
ESB
ESB
Sandesha2/Java
Axis2/Java
Synapse/Java
Rampart/Java
WSAS/Java
AXIOM/Java
ESB/Java
JMS
Mashup server
Mashup Server
OpenID
open source
WSF/PHP
PHP
Proxy Services
rampart
Rampart
Registry
REST
Sandesha2
security
SOA
soap
Spring
Synapse
Synapse
Training
webinar
Web Services
WS-Security
WSAS
WSAS
wsdl
wsf
WSF/C
WSF/PHP
WSO2
WSO2 WSF/PHP










