I have an axis service that is working fine...  the Java2WSDL and WSDL2Java
both work correctly, and using the
http://my.domain.com:8080/axis/services/ServiceName?method=findAll
returns the proper data...  however, I am having probems with using the
client side stubs which work correctly for services that don't return
complex types:

i.e. the following is the same as what I use for simple services, but
returns an axis fault...

---------------------------------------------------------
LessonService2ServiceLocator service = new LessonService2ServiceLocator();
LessonService2 port = service.getLessonService2();
Vector result = port.findAll();
---------------------------------------------------------

the error is:
---------------------------------------------------------
Caused by: java.io.IOException: No serializer found for class
com.hmcon.lesson.Lesson in registry
[EMAIL PROTECTED]
---------------------------------------------------------

If I use the following code:

---------------------------------------------------------
String SOAP_ENDPOINT =
http://my.domain.com:8080/axis/services/LessonService;
String METHOD = "findAll";
String ACTION_URI = "";
String TYPEMAPPINGS_URN = "urn:LessonServiceTypes";
QName LESSON_QN = new QName( TYPEMAPPINGS_URN, "Lesson" );
QName LESSON_VECTOR_QN = new QName( TYPEMAPPINGS_URN, "VectorOfLessons" );
try {
// start the service call...
Service service = new Service();
Call call = (Call) service.createCall();
call.setEncodingStyle( org.apache.axis.Constants.URI_SOAP12_ENC );
call.setTargetEndpointAddress( new java.net.URL(SOAP_ENDPOINT) );
call.setReturnType( LESSON_VECTOR_QN );
call.registerTypeMapping( Lesson.class,
LESSON_QN,
org.apache.axis.encoding.ser.BeanSerializerFactory.class,
org.apache.axis.encoding.ser.BeanDeserializerFactory.class );
call.registerTypeMapping( java.util.Vector.class,
LESSON_VECTOR_QN,
org.apache.axis.encoding.ser.ArraySerializerFactory.class,
org.apache.axis.encoding.ser.ArrayDeserializerFactory.class );
call.setUseSOAPAction( true );
call.setSOAPActionURI( ACTION_URI );
call.setOperationStyle( "rpc" );
call.setOperationName( new QName(ACTION_URI, METHOD) );
Object[] inputParams = new Object[] { };
Vector results = (Vector) call.invoke( inputParams );
---------------------------------------------------------

It works as expected...

Is there any way to use the stub with part of the other code, or modify the
stubs to do what they need to to get the first example working...  I'm
pretty new to Axis and services, so if I'm missing something simple, please
excuse...

Thanks in advance...

JH


-- 

Jeffrey Hood
President
HM Consulting, Inc.
30 McGovern Ave.
Lancaster, PA  17602
717.509.6558
jhood
hmcon  [d]  com



Reply via email to