axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Hoffer" <DHof...@xrite.com>
Subject WebService error calling JNI methods
Date Sat, 12 Feb 2005 02:08:40 GMT
I get the following error when I call my web service methods: 

An unhandled exception of type
'System.Web.Services.Protocols.SoapException' occurred in
system.web.services.dll
Additional information: java.lang.reflect.InvocationTargetException

I have 1 public method in my java code which calls the same method in a
C library...
package com.xrite.lzb;
public class LZB {
  public static boolean Measure(String szIPAddress, int iPortNumber) {
    return LZBJNI.Measure(szIPAddress, iPortNumber); } 
}
class LZBJNI {
  static {
    try {
        System.loadLibrary("LZB"); } 
    catch (UnsatisfiedLinkError e) {  System.exit(1); } }

  public final static native boolean Measure(String jarg1, int jarg2); 
}

The C library has 1 exported method like...
JNIEXPORT jboolean JNICALL Java_com_xrite_lzb_LZBJNI_Measure(JNIEnv
*jenv, jclass jcls, jstring jarg1, jint jarg2);

The compiled java code is located in the axis classes folder like...
WEB-INF\classes\com\xrite\lzb\LZB.class & LZBJNI.class

I have found that a real problem is where to put the C library.  For now
I have found that in the path of java works so right now they are at
C:\j2sdk1.4.2_06\bin.

I had this working (with the kludge of where to put the C library)
before I added the package name (com.xrite.lzb) to the java code so I
think the error is related to the package name change.  I added the
package name because we could not get the client web service method call
to work without it (we are calling the method from some JavaScript in
Firefox browser).  In addition, I can call the above code with a local
java client calling the methods directly without using the web service. 

I notice in the wsdl generated by axis that the namespace is reversed,
shown below, why is this?
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://lzb.xrite.com" use="encoded"/>

What is going on?  Why do I get this error?  Where should the java
classes & C libraries go?  How should I use namespaces in my java code?
Do I need to remove the java package name and specify namespaces in my
wsdd somehow?

Thanks for any assistance you can provide!

-dh



Mime
View raw message