Hi ,

I am trying to access my web service from the servlet and the servlet is acting as my client. But while i am trying to call my service through that servlet its throwing me java lang Invocation exception.

I am sending my snippet of code on how i am accessing my web service from the servlet as client.

           String uri="http://com.trilliant.service";;
           String servicename="SearchService";
           try{
ServiceFactory serviceFactory=(ServiceFactory) ServiceFactory.newInstance(); Service service=(Service) serviceFactory.createService(new QName(uri,servicename)); TypeMappingRegistry regiMapping=(TypeMappingRegistry) service.getTypeMappingRegistry(); TypeMapping map=(TypeMapping) regiMapping.getDefaultTypeMapping(); QName deviceQName= new QName("http://com.trilliant.service","Device";); map.register(Device.class, deviceQName, new BeanSerializerFactory(Device.class, deviceQName), new BeanDeserializerFactory(Device.class, deviceQName));
           Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new URL("http://localhost:8080/axis/services/search";));
           call.setProperty(Call.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);
           call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
call.setProperty(Call.SOAPACTION_URI_PROPERTY, "http://com.trilliant.service";);
           call.setOperationName( new QName(uri, "searchDeviceById") );
dev = (com.trilliant.clientcode.Device) call.invoke(new Object[]{ deviceId });

Please help me in resolving this problem or tell me if i have made any mistake in the code.
Looking out for help from somebody so that i can proceed.
Thanks in advance.
Regards




This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient or received it in error, please contact 
the sender by reply e-mail and destroy all copies of the original message. 
Please do not copy it for any purpose or disclose its contents.

Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights Reserved

Reply via email to