Announcement Announcement Module
Collapse
No announcement yet.
Axis Conversion Help Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Axis Conversion Help

    Hi Guys.

    I got confused trying to access a web service using spring....

    Here is a working code...

    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 ) ;
    and another working code using stubs.....
    Code:
            UserManagementWebService umws = new UserManagementWebServiceServiceLocator().getUserManagementWebService() ;
            result = umws.ws_AuthenticateUser( "xxxxxxxxxx", MD5.getHashString("xxxxxxxxx") );
            System.out.println( "result="+result ) ;
    now when i try to access using spring web services, i got the error...
    Code:
    javax.xml.rpc.ServiceException: Error processing WSDL document:  
    javax.xml.rpc.ServiceException: Cannot find service:..........
    Heres my bean definition....
    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>
    Heres a snippet of the wsdl...
    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>
    I hope someone can help me find the correct service name and port name.

    TIA!

    Richard

  • #2
    I seem to have got a better values wiring the web service.....

    I now got this error....

    Code:
    INFO: Using service interface [UserManagementWebService_pkg.UserManagementWebServiceService] for JAX-RPC port [{urn:UserManagementWebService}UserManagementWebService] - not directly implemented
    Aug 18, 2006 4:39:32 PM org.springframework.aop.framework.DefaultAopProxyFactory <clinit>
    INFO: CGLIB2 not available: proxyTargetClass feature disabled
    Exception in thread "main" org.springframework.remoting.RemoteProxyFailureException: No matching RMI stub method found for: public abstract UserManagementWebService_pkg.UserManagementWebService UserManagementWebService_pkg.UserManagementWebServiceService.getUserManagementWebService() throws javax.xml.rpc.ServiceException; nested exception is java.lang.NoSuchMethodException: UserManagementWebService_pkg.UserManagementWebServiceSoapBindingStub.getUserManagementWebService()
    Caused by: java.lang.NoSuchMethodException: UserManagementWebService_pkg.UserManagementWebServiceSoapBindingStub.getUserManagementWebService()

    Comment


    • #3
      Hope someone can give any comments....thanks!

      Comment


      • #4
        Use Xfire

        I was using axis api and find out it was not so good api to use. So many things to set and so on and axis2 is even worse. Xfire supports spring so that is the way you shoud follow.

        Comment


        • #5
          You mean this xfire...??

          http://xfire.codehaus.org/

          Originally posted by hakalpet
          I was using axis api and find out it was not so good api to use. So many things to set and so on and axis2 is even worse. Xfire supports spring so that is the way you shoud follow.
          Thanks!

          Comment

          Working...
          X