Saturday, March 24, 2012

Authentication in Jboss webservice client

URL url = null;
url = new URL("file:/c:/test/test.wsdl");


    PRODGenericDataAccessSoap soap = super.getPort(PRODGenericDataAccessSoap, PRODGenericDataAccessSoap.class);
        BindingProvider bp = (BindingProvider)soap;
        bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "jijo");

//username is jijo
        bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "jijo"); 

//passowrd is jijo
        return soap; 


16:12:49,843 WARN  [org.apache.cxf.phase.PhaseInterceptorChain] Interceptor for {http://www.prodml.org/api/200/genericDataAccess}PROD_GenericDataAccess#{http://www.prodml.org/api/200/genericDataAccess}GetData has thrown exception, unwinding now: java.lang.RuntimeException: Can't find input stream in message
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116) [:2.3.1]
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60) [:2.3.1]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755) [:2.3.1]
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330) [:2.3.1]
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192) [:2.3.1]
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036) [:2.3.1]
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) [:2.3.1]
    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696) [:2.3.1]
    at 16:12:51,765 ERROR [STDERR] javax.xml.ws.soap.SOAPFaultException: Can't find input stream in message