AnsweredAssumed Answered

While calling getUser() Method. Getting access denied error.

Question asked by la0045454 on Aug 27, 2017
Latest reply on Apr 15, 2018 by ta0070620

Dear Friends,

We converted Context_WS.wsdl and User_WS.wsdl  into java client.

We used wsdl2java command and used AXIS2 API to convert wsdl into java client.

While calling getUser() Method. Getting access denied error.

blackboard.ws.user.xsd.UserVO uservo[]=userwsstub.getUser(getuser).get_return();

 

org.apache.axis2.AxisFault: [WSFW004]<b>Access Denied</b><br>Access to this resource is prohibited. (system.useradmin.generic.VIEW)

                at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)

                at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)

                at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)

                at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)

                at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)

                at blackboard.ws.user.UserWSStub.getUser(UserWSStub.java:745)

 

 

Below is getUser method body.

 

public blackboard.ws.user.GetUserResponse getUser(

        blackboard.ws.user.GetUser getUser38) throws java.rmi.RemoteException {

        try {

            org.apache.axis2.client.OperationClient _operationClient =_serviceClient.createClient(_operations[2].getName());

            _operationClient.getOptions().setAction("getUser");

            _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);

          

 

            addPropertyToOperationClient(_operationClient,

                org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,

                "&");

 

            // create a message context

            org.apache.axis2.context.MessageContext _messageContext = neworg.apache.axis2.context.MessageContext();

 

            // create SOAP envelope with that payload

            org.apache.axiom.soap.SOAPEnvelope env = null;

 

            env = toEnvelope(getFactory(_operationClient.getOptions()

                                                        .getSoapVersionURI()),

                    getUser38,

                    optimizeContent(

                        new javax.xml.namespace.QName(

                            "http://user.ws.blackboard/", "getUser")));

 

            //adding SOAP soap_headers

            _serviceClient.addHeadersToEnvelope(env);

            // set the message context with that soap envelope

            _messageContext.setEnvelope(env);

 

            // add the message contxt to the operation client

            _operationClient.addMessageContext(_messageContext);

 

            //execute the operation client

            _operationClient.execute(true); // line 745

 

            org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);

            org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();

 

            java.lang.Object object = fromOM(_returnEnv.getBody()

                                                       .getFirstElement(),

                    blackboard.ws.user.GetUserResponse.class,

                    getEnvelopeNamespaces(_returnEnv));

            _messageContext.getTransportOut().getSender()

                           .cleanup(_messageContext);

 

            return (blackboard.ws.user.GetUserResponse) object;

Outcomes