JBoss Community

web service response modification when authentication failed.

created by jilani2423 in JBoss Web Services Development - View the full discussion

Hi,

 

I have a jax ws based webservice with handler in place for user authentication.

 

I am returning false in handleMessage when the user is not authorised. So it si not calling the web service implementation method, but it is returning the reponse as request not the custome response. How to write the custoom response when authentication failed using handler.

 

My wsdl request format:

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:n1="http://www.n1.com">

   <soapenv:Header/>

   <soapenv:Body>

      <n1:getData>

         <authenticationKey>

            <n1:userID>userID</n1:userID>

            <n1:password>password</n1:password>

         </authenticationKey>

         <SearchCriteria>

......

 

My wsdl response, when the authentication failed

 

<soapenv:Envelope xmlns:n1='http://www.n1.com' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Header></soapenv:Header><soapenv:Body>

      <n1:getData>

         <authenticationKey>

            <n1:userID xmlns:n1='http://www.n1.com'>invaliduserid</n1:userID>

            <n1:password xmlns:n1='http://www.n1.com'>password</n1:password>

         </authenticationKey>

         <SearchCriteria>

.....

 

What I need in response is

 

<soapenv:Envelope xmlns:n1='http://www.n1.com' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Header></soapenv:Header><soapenv:Body>

      <n1:getData>

            <n1:userID xmlns:n1='http://www.n1.com'>authentication failed</n1:userID>

.....

 

Please suggest me the approach to get the required response.

 

Thank You,

Jilani

Reply to this message by going to Community

Start a new discussion in JBoss Web Services Development at Community