Hi Guys.
I got confused trying to access a web service using spring....
Here is a working code...
and another working code using stubs.....Code:Service service = new Service(); Call call = (Call) service.createCall(); call.setMaintainSession(true); URL url = new URL("http://wservice.xxxxxx:2070/axis/services/UserManagementWebService"); call.setTargetEndpointAddress( url ); call.clearOperation(); call.removeAllParameters(); call.setOperationName( new QName("urn:UserManagementWebService", "ws_AuthenticateUser")); call.addParameter( "username", XMLType.XSD_STRING, ParameterMode.IN ); call.addParameter( "pwd", XMLType.XSD_STRING, ParameterMode.IN ); call.setReturnType( XMLType.XSD_BOOLEAN ); boolean result = (Boolean) call.invoke( new Object[]{ "xxxxxxxxx", MD5.getHashString("xxxxxx") } ) ; System.out.println( "result="+result ) ;
now when i try to access using spring web services, i got the error...Code:UserManagementWebService umws = new UserManagementWebServiceServiceLocator().getUserManagementWebService() ; result = umws.ws_AuthenticateUser( "xxxxxxxxxx", MD5.getHashString("xxxxxxxxx") ); System.out.println( "result="+result ) ;
Heres my bean definition....Code:javax.xml.rpc.ServiceException: Error processing WSDL document: javax.xml.rpc.ServiceException: Cannot find service:..........
Heres a snippet of the wsdl...Code:<bean id="UserManagementWS" class="org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean"> <property name="serviceInterface" value="UserManagementWebService_pkg.UserManagementWebService"/> <property name="wsdlDocumentUrl" value="http://wservice.xxxxxx:2070/axis/services/UserManagementWebService?WSDL"/> <property name="namespaceUri" value="http://wservice.xxxxxx:2070/axis/services/UserManagementWebService"/> <property name="serviceName" value="UserManagementWebService"/> <property name="portName" value="UserManagementWebService"/> </bean>
I hope someone can help me find the correct service name and port name.Code:</wsdl:binding> − <wsdl:service name="UserManagementWebServiceService"> − <wsdl:port name="UserManagementWebService" binding="impl:UserManagementWebServiceSoapBinding"> <wsdlsoap:address location="http://wservice.xxxxxxx:2070/axis/services/UserManagementWebService"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
TIA!
Richard


Reply With Quote