Hi,

I want to create a client for a series of previously unknown services
and I don't want to generate stubs for every possible service. After
some research, I found out that using apache axis is possible for a
client to dynamically download the WSDL and invoke operations on the
service without the stubs. As GT 4.2.0 is based on Axis 1.4,  I tried
the same solution when developing my client. As an example, I coded
and deployed the Math Service from chapter 6 of the book "Globus
Toolkit 4: Programming Java Services". Even though the book is based
on a previous version of Globus, I was able to set the service running
on GT 4.2.0. The Math Service's files are those available at
http://www.gt4book.com and I didn't alter them. The client included in
the package works just fine, the service is invoked and the values are
returned correctly.

My client code is the following:

public class ClientDynamic {

        public static void main(String[] args) {
                String serviceURI = args[0];
                Service service = new Service();
                Call call  = (Call) service.createCall();
                call.setTargetEndpointAddress(new URL(serviceURI));
                call.setOperationName(new
QName("http://www.globus.org/namespaces/examples/MathService_instance","add";));
                call.addParameter("add", XMLType.XSD_INT, ParameterMode.IN);
                call.setReturnType(XMLType.AXIS_VOID);
                Integer a = new Integer(1);
                call.invoke(new Object[] {a});
        }
}

full code at: http://pastie.org/695942

When I run the new client, the following error message arises:

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: org.xml.sax.SAXException: SimpleDeserializer encountered
a child element, which is NOT expected, in something it was trying to
deserialize.
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException:
SimpleDeserializer encountered a child element, which is NOT expected,
in something it was trying to deserialize.

full error at: http://pastie.org/695954

It appears that there's something wrong in the way I set up the
parameters for the method. Any thoughts?

thanks for your attention.

-- 
__________________________________
João Marcelo Uchôa de Alencar
Computer Science BSc.
jmarcelo.alencar(at)gmail.com
http://simetriade.blogspot.com
Linux User 398939
__________________________________

Reply via email to