axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stadelmann Josef" <>
Subject [AXIS2/Java 1.2] xPath.selectSingleNode(element) does not return an OMElement when used on OpenVMS from a AXIS2 webservice but works on OpenVMS client code
Date Wed, 02 Apr 2008 16:21:34 GMT
Hi AXIOMXPath Experts,

	I use Axis2 1.2 on Topy of Tomcat on top of JDK 1.4.2-n both Windows and OpenVMS
	(I know I migth have to upgrade AXIS2/Java, see environment below)

	my routine getUsername(element) runs nicely from an Axis2SOAPClient on Window 2000 and OpenVMS

	The exact same code dose however NOT run when used on OpenVMS in our SpezplaService (Axis2/Java
web service.)
	See correct launch/deployment below

	The statement 
	OMElement user = (OMElement) xPath.selectSingleNode(element);
	always returns NULL to user

	The element in which we seek the xPath (expression) looks identical, at least I can not see
a difference.
	element.toString shown below

	The thing which botters me a bit is, that when I convert the received OMElement to a string
	AXIS2/Java SpezplaService.login(), I can see an escaping technique used for each xmlns uri.

	Migth this be the reason why xPath.selectSingleNode(element); does not find what I want and
returns no OMElement ??????
	In short loking at the xPath added name spaces they look the same on client and server but
	what if this name spaces are not not found due to some escaping technices used internal of
the OMElement?

	my element up on which I try to seek for USERNAME

	"<b:root xmlns:d=\"WS\" xmlns:b=\"SPS-Payload\" xmlns:c=\"COL\" xmlns:e=\"feld\"><c:col><d:wsinp><e:TARGET>FKT_WMBCREATE</e:TARGET><e:SELECT

	Any hints and thougths are very welcome.


    private static String getUsername(OMElement element){
        try {
             * -TODO--
             * deliver Username in a encrypted form; i.e. use a hashing technique or
             * better use Rampart and a WS-Security Modell / Policy AND 
             * Transport Level Security such as HTTPS
            String s10 = element.getNamespace().getPrefix();		// it's b
            String s11 = element.getNamespace().getNamespaceURI();	// it's SPS-Payload
//              AXIOMXPath xPath = new AXIOMXPath("//soapenv:Envelope/soapenv:Body/b:root/c:col/d:wsinp/e:USERNAME");
            AXIOMXPath xPath = new AXIOMXPath("//b:root/c:col/d:wsinp/e:USERNAME");
//              xPath.addNamespace("soapenv","");
//              xPath.addNamespace("wsa","");
            OMElement user = (OMElement) xPath.selectSingleNode(element);
            return user.getText();
        } catch (JaxenException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
            System.out.println("Unknown JaxenException at SpezplaService.getUsername()");
        } catch (Exception ex) {
            System.out.println("Unknown Java exception at SpezplaService.getUsername()");
        return "";

my environment looks like that: on OpenVMS

NOTE: I can not use JDK 1.5.0 due to beeing unable to use JPDA connector to debug from 
NetBeans IDE (need to attache to my web service)

Tomcat listens on port 8000 for a NetBeans IDE debugger attache request

$   j_cmd "-version"
0: dsa0:[sys0.syscommon.][java$142.bin]java$java.exe;1
1: -version
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition
Classic VM (build 1.4.2-5, 03/06/2006-23:29, native threads, jit)
$   j_cmd "-V" "APACHE$SPECIFIC:[000000]TOMCAT_JVM_DBG_ARGS.DAT"   "-V" "sys$scratch:apache$jakarta_secparamfile.000045F0"
                "org.apache.catalina.startup.Bootstrap" -
        "-V" "sys$scratch:apache$jakarta_paramfile.000045F0" "start"
0: dsa0:[sys0.syscommon.][java$142.bin]java$java.exe;1
1: -Xms64m
2: -Xmx512m
3: -Xdynclassgc
4: -Xdebug
5: -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n
6: -Xnoagent
7: -Djava.compiler=NONE
8: -Djava.endorsed.dirs=/dsa5/apache/jakarta/tomcat/common/endorsed
9: -Dcatalina.base=/dsa5/apache/jakarta/tomcat/
10: -Dcatalina.home=/dsa5/apache/jakarta/tomcat/
11: -Dcatalina.tmpdir=/dsa5/apache/jakarta/tomcat/temp
12: org.apache.catalina.startup.Bootstrap
13: JPDA
14: start
Created MBeanServer with ID:
usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { start
| stop }
- Initializing Coyote HTTP/1.1 on http-8080
- Initialization processed in 55584 ms
- Starting service Catalina
- Starting Servlet Engine: Apache Tomcat/5.5.9
- XML validation disabled
- Deploying web application archive axis2.war
- Deploying module: addressing-1.2
- Deploying module: soapmonitor-1.2
- Deploying module: SpezplaLogging-1.2
[JAM] Warning: You are running under a pre-1.5 JDK.  JSR175-style source annotations will
not be available
- Deploying Web service: SpezplaService.aar
- Deploying Web service: version.aar


View raw message