Skip to main content

PUT/DELETE documents to Mobicents XDMS ?

2 replies [Last post]
sondn
Offline
Joined: 2009-09-24

Hi everybody,

I'm trying to test and control Mobicents XDMS, so I installed Mobicents XDMS with "mobicents-sip-presence-xdms-1.0.0.BETA5" pakage, and installation seem ok. But when i tested, i involved some problem

==>> I can GET ready document "/xcap-caps/global/index" from XDMS by browser, but when i try to PUT/DELETE documents, i encounter with NotAuthorizedRequestException, here is log lines from terminal:

2009-09-25 11:33:31,728 INFO [org.openxdm.xcap.server.slee.AggregationProxySbb] put(resourceSelector=/resource-lists/users/sip:eduardo@192.168.1.50/retry,mimetype=application/resource-lists+xml,eTagValidator=null,xcapRoot=/mobicents)
2009-09-25 11:33:31,731 ERROR [org.openxdm.xcap.server.slee.AggregationProxySbb] Error processing onPut()
org.openxdm.xcap.common.error.NotAuthorizedRequestException
at org.openxdm.xcap.server.slee.RequestProcessorSbb.put(RequestProcessorSbb.java:834)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectInterceptor.invokeAndReturnObject(SbbLocalObjectInterceptor.java:72)
at org.openxdm.xcap.server.slee.RequestProcessorSbbLocalObjectImpl.put(RequestProcessorSbbLocalObjectImpl.java)
at org.openxdm.xcap.server.slee.AggregationProxySbb.onPut(AggregationProxySbb.java:380)
at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.mobicents.slee.runtime.sbbentity.SbbEntity.invokeEventHandler(SbbEntity.java:759)
at org.mobicents.slee.runtime.EventRouterImpl.routeQueuedEvent(EventRouterImpl.java:933)
at org.mobicents.slee.runtime.EventRouterImpl.access$100(EventRouterImpl.java:64)
at org.mobicents.slee.runtime.EventRouterImpl$EventExecutor.run(EventRouterImpl.java:121)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
at java.lang.Thread.run(Thread.java:595)

I wrote a simple code based on Mobicents XCAP client API, this is my code:

package org.openxdm.xcap.client;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.httpclient.HttpException;
import org.openxdm.xcap.common.key.UserDocumentUriKey;

/**
*
* @author root
*/
public class client_PUT {

public client_PUT() {

}
public static void main(String [ ] args) throws HttpException, IOException {

XCAPClient client = null;
try {
client = new XCAPClientImpl("192.168.1.50", 8080, "/mobicents");
}
catch (InterruptedException ex) {
Logger.getLogger(client_PUT.class.getName()).log(Level.SEVERE, null, ex);
}
client.setAuthenticationCredentials("admin", "admin");
client.setDoAuthentication(true);

UserDocumentUriKey key = new UserDocumentUriKey("resource-lists","sip:eduardo@192.168.1.50","retry");

String document = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
// "" +
// "" +
//"";
"" +
"" +
"http://xcap.example.com/resource-lists/users" +
"/sip:joe@example.com/index/~~/resource-lists/list%5b@name=%22l1%22%5d" +
"" +
"presence" +
"" +
"";

// send put request, application usage mimetype is needed

Response response = client.put(key,"application/resource-lists+xml",document,null);

}
}

The user profile "admin" is created from JMX web console. Can you explain and show me how to resolve this problem, please?

==>>Another problem is database. Is there any tools to create new user's "directory" in "/auid/users/"? For example, i want create "directory" sip:alice@xdms.ims.com in "resource-lists/users/"
Or, COLLECTION_NAME field of XDM_DATASOURCE_DOCUMENTS may be "global" or AORs indicates user (eg: sip:alice@xdms.ims.com) and all XML documents belong to one single-human are underneath that AOR ? It means that COLLECTION_NAME doesn't have only "global" and "users" value but has "global" and AORs ??

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
eduardomartins
Offline
Joined: 2005-10-10

> Hi everybody,
>
> I'm trying to test and control Mobicents XDMS, so I
> installed Mobicents XDMS with
> "mobicents-sip-presence-xdms-1.0.0.BETA5" pakage, and
> installation seem ok. But when i tested, i involved
> some problem
>
> ==>> I can GET ready document
> "/xcap-caps/global/index" from XDMS by browser, but
> when i try to PUT/DELETE documents, i encounter with
> NotAuthorizedRequestException, here is log lines
> from terminal:
>
> [b]2009-09-25 11:33:31,728 INFO
> [org.openxdm.xcap.server.slee.AggregationProxySbb]
> put(resourceSelector=/resource-lists/users/sip:eduard
> @192.168.1.50/retry,mimetype=application/resource-list
> s+xml,eTagValidator=null,xcapRoot=/mobicents)
> 2009-09-25 11:33:31,731 ERROR
> [org.openxdm.xcap.server.slee.AggregationProxySbb]
> Error processing onPut()
> org.openxdm.xcap.common.error.NotAuthorizedRequestExce
> ption
> at
> t
> org.openxdm.xcap.server.slee.RequestProcessorSbb.put(R
> equestProcessorSbb.java:834)
> at
> t sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
> t
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
> odAccessorImpl.java:39)
> at
> t
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
> tingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:592)
> at
> t
> org.mobicents.slee.container.deployment.interceptors.S
> bbLocalObjectInterceptor.invokeAndReturnObject(SbbLoca
> lObjectInterceptor.java:72)
> at
> t
> org.openxdm.xcap.server.slee.RequestProcessorSbbLocalO
> bjectImpl.put(RequestProcessorSbbLocalObjectImpl.java)
>
> at
> t
> org.openxdm.xcap.server.slee.AggregationProxySbb.onPut
> (AggregationProxySbb.java:380)
> at
> t
> sun.reflect.GeneratedMethodAccessor100.invoke(Unknown
> Source)
> at
> t
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
> tingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:592)
> at
> t
> org.mobicents.slee.runtime.sbbentity.SbbEntity.invokeE
> ventHandler(SbbEntity.java:759)
> at
> t
> org.mobicents.slee.runtime.EventRouterImpl.routeQueued
> Event(EventRouterImpl.java:933)
> at
> t
> org.mobicents.slee.runtime.EventRouterImpl.access$100(
> EventRouterImpl.java:64)
> at
> t
> org.mobicents.slee.runtime.EventRouterImpl$EventExecut
> or.run(EventRouterImpl.java:121)
> at
> t
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask
> (ThreadPoolExecutor.java:651)
> at
> t
> java.util.concurrent.ThreadPoolExecutor$Worker.run(Thr
> eadPoolExecutor.java:676)
> at java.lang.Thread.run(Thread.java:595)
>
> [/b]
>
>
> I wrote a simple code based on Mobicents XCAP client
> API, this is my code:
>
> [i]package org.openxdm.xcap.client;
>
> import java.io.IOException;
> import java.util.logging.Level;
> import java.util.logging.Logger;
> import org.apache.commons.httpclient.HttpException;
> import
> org.openxdm.xcap.common.key.UserDocumentUriKey;
>
> /**
> *
> * @author root
> */
> ublic class client_PUT {
>
> public client_PUT() {
>
> }
> public static void main(String [ ] args) throws
> HttpException, IOException {
>
> XCAPClient client = null;
> try {
> client = new
> XCAPClientImpl("192.168.1.50", 8080, "/mobicents");
> }
> catch (InterruptedException ex) {
>
> ogger.getLogger(client_PUT.class.getName()).log(Level.
> SEVERE, null, ex);
> }
> nt.setAuthenticationCredentials("admin", "admin");
> client.setDoAuthentication(true);
>
> UserDocumentUriKey key = new
> UserDocumentUriKey("resource-lists","sip:eduardo@192.1
> 68.1.50","retry");
>
> String document = " > version=\"1.0\" encoding=\"UTF-8\"?>" +
> // " > xmlns=\"urn:ietf:params:xml:ns:resource-lists\">" +
> // "
> name=\"friends\"/>" +
>
> /"";
> " > xmlns=\"urn:ietf:params:xml:ns:rls-services\"" +
>
> xmlns:rl=\"urn:ietf:params:xml:ns:resource-lists\""+
>
> xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\
> ">" +
> " > uri=\"sip:mybuddies@example.com\">" +
>
> http://xcap.example.com/resource-lists/
> users" +
>
> /sip:joe@example.com/index/~~/resource-lists/list%5b@n
> ame=%22l1%22%5d
" +
> "
" +
> "
presence" +
> "
" +
> "";
>
>
> // send put request, application usage mimetype is
> needed
>
> Response response =
> client.put(key,"application/resource-lists+xml",docum
> nt,null);
>
> }
> [/i]
>
> The user profile "admin" is created from JMX web
> console. Can you explain and show me how to resolve
> this problem, please?

We have no support for the concept of an "admin" user through XCAP, if you want to put a document in /auid/users/sip:eduardo@192.168.1.50 then you need to authenticate with the account sip:eduardo@192.168.1.50.

At some point a management tool should probably be created to make it easier for "admin" tasks directly on the database.

> ==>>Another problem is database. Is there any tools
> to create new user's "directory" in "/auid/users/"?
> For example, i want create "directory"
> sip:alice@xdms.ims.com in "resource-lists/users/"
> r, COLLECTION_NAME field of XDM_DATASOURCE_DOCUMENTS
> may be "global" or AORs indicates user (eg:
> sip:alice@xdms.ims.com) and all XML documents belong
> to one single-human are underneath that AOR ? It
> means that COLLECTION_NAME doesn't have only "global"
> and "users" value but has "global" and AORs ??

You can create it using any database tool with support for Hypersonic, the Jboss AS includes one. Here is a how to from a google search:

http://davidsalter.co.uk/blog/?p=270

-- Eduardo

sondn
Offline
Joined: 2009-09-24

Thank Eduardo,

Indeed, i was silly when authenticate with "admin" user to PUT document for "sip:eduardo@192.168.1.50" user, :-).
The user "admin" i created not with administration meaning, but just normal user. Anyway, i involved with basic fault, :-(