You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by Daniele Renda <da...@gmail.com> on 2009/11/20 18:38:46 UTC

INFO ABOUT XML RPC METHOD CALL

Hi,
I've a question about the newXmlRpcHandlerMapping() method on XmlRpcServlet.

I've a test class as this:

@Override
	protected XmlRpcHandlerMapping newXmlRpcHandlerMapping()
			throws XmlRpcException {
		PropertyHandlerMapping mapping;
		URL url = XmlServlet.class.getResource("XmlRpcServlet.properties");
		if (url == null) {
			throw new XmlRpcException(
					"Failed to locate resource XmlRpcServlet.properties");
		}
		try {
			mapping = newPropertyHandlerMapping(url);
		} catch (IOException e) {
			throw new XmlRpcException("Failed to load resource " + url + ": "
					+ e.getMessage(), e);
		}

		AbstractReflectiveHandlerMapping.AuthenticationHandler handler = new
AbstractReflectiveHandlerMapping.AuthenticationHandler() {
			public boolean isAuthorized(XmlRpcRequest pRequest) {
				XmlRpcHttpRequestConfig config = (XmlRpcHttpRequestConfig) pRequest
						.getConfig();
				return isAuthenticated(config.getBasicUserName(), config
						.getBasicPassword());
			}
		};
		mapping.setAuthenticationHandler(handler);
		return mapping;
	}

and in my XmlRpcServlet.properties I've the mapping of the class
(MethodExample.java) that exports public methods. But how I can get
username and password in my MethodExample.java since is a POJO?

Thanks very much.

Best regards

-- 
Daniele Renda