AXL 8.5 getUser returns internal server error 500 when user cannot be found

Version 1
    This document was generated from CDN thread

    Created by: david brawner on 03-07-2012 01:57:20 PM
    I am trying to detect if a user is found in the CCM 8.5 enduser table.
     
    Here is the SOAp tha tgets sent:
     
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <SOAP-ENV:Body>
        <axl:getUser xmlns:axl="http://www.cisco.com/AXL/API/8.5" xsi:schemaLocation="http://www.cisco.com/AXL/API/8.5 http://nsa.ipt.slb.net/schema/axlsoap.xsd" xsi:type="XRequest" sequence="1234">
          <userid>DBrawner</userid>
        </axl:getUser>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
     
     
     
    When the user is found, the normal get user response is returned.
     
    When the user cannot be found the AXL log shows this, but returns a internal server error 500.
     
     <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <SOAP-ENV:Body>
        <axl:getUser xmlns:axl="http://www.cisco.com/AXL/API/8.5" xsi:schemaLocation="http://www.cisco.com/AXL/API/8.5 http://nsa.ipt.slb.net/schema/axlsoap.xsd" xsi:type="XRequest" sequence="1234">
          <userid>DBraawner</userid>
        </axl:getUser>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    2012-07-03 16:19:03,992 DEBUG [http-8443-114] servletRouters.AXLFilter - Request is not a write request
    2012-07-03 16:19:03,992 DEBUG [http-8443-114] servletRouters.AXLFilter - Successfully set the value of counter: 4 value: 0
    2012-07-03 16:19:03,992 INFO  [http-8443-114] servletRouters.AXLAlpha - SOAPAction : CUCMB ver=8.5
    2012-07-03 16:19:03,993 INFO  [http-8443-114] servletRouters.AXLAlpha - Going to axis--->
    2012-07-03 16:19:03,997 DEBUG [http-8443-114] axlapiservice.Handler - DBraawner is not a number
    2012-07-03 16:19:03,998 DEBUG [http-8443-114] axlapiservice.Handler - select pkid from EndUser where my_lower(userid ) =my_lower('DBraawner' )
    2012-07-03 16:19:04,000 ERROR [http-8443-114] axlapiservice.AXLAPIServiceSkeleton - com.cisco.www.axlapiservice.AXLAPIServiceSkeleton@4856fc
    com.cisco.www.axlapiservice.ItemNotValidException: Item not valid: The specified User was not found
     at com.cisco.www.axlapiservice.Handler.getPkid(Handler.java:2355)
     at com.cisco.www.axlapiservice.Handler.extractPkIdFromWhereMap(Handler.java:4062)
     at com.cisco.www.axlapiservice.GetUserHandler.doGet(GetUserHandler.java:55)
     at com.cisco.www.axlapiservice.AXLAPIServiceSkeleton.getUser(AXLAPIServiceSkeleton.java:13684)
     at com.cisco.www.axlapiservice.AXLAPIServiceMessageReceiverInOut.invokeBusinessLogic(AXLAPIServiceMessageReceiverInOut.java:7626)
     at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
     at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
     at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
     at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
     at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:131)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     at sun.reflect.GeneratedMethodAccessor2382.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269)
     at java.security.AccessController.doPrivileged(Native Method)
     at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
     at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:301)
     at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
     at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
     at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
     at java.security.AccessController.doPrivileged(Native Method)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
     at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
     at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
     at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
     at org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatcher.java:65)
     at org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(ApplicationDispatcher.java:80)
     at java.security.AccessController.doPrivileged(Native Method)
     at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:294)
     at com.cisco.www.servletRouters.AXLAlpha.doPost(Unknown Source)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     at sun.reflect.GeneratedMethodAccessor194.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269)
     at java.security.AccessController.doPrivileged(Native Method)
     at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
     at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:301)
     at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
     at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
     at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
     at java.security.AccessController.doPrivileged(Native Method)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
     at com.cisco.www.servletRouters.AXLFilter.doFilter(Unknown Source)
     at sun.reflect.GeneratedMethodAccessor331.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269)
     at java.security.AccessController.doPrivileged(Native Method)
     at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
     at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:301)
     at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:243)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
     at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
     at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
     at java.security.AccessController.doPrivileged(Native Method)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
     at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:394)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
     at java.lang.Thread.run(Thread.java:662)
    2012-07-03 16:19:04,001 DEBUG [http-8443-114] axlapiservice.AXLCallFlow - In AXL CAll Flow
    2012-07-03 16:19:04,001 DEBUG [http-8443-114] axlapiservice.AXLCallFlow - In AXL CAll Flow errorCodeStringItem not valid: The specified User was not found
    2012-07-03 16:19:04,002 DEBUG [http-8443-114] axlapiservice.AXLCallFlow - Setting soap fault
    2012-07-03 16:19:04,002 DEBUG [http-8443-114] axlapiservice.AXLCallFlow - Setting soap fault2
    2012-07-03 16:19:04,003 INFO  [http-8443-114] servletRouters.AXLAlpha - Request processed by AXIS
    2012-07-03 16:19:04,003 INFO  [http-8443-114] servletRouters.AXLFilter - <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="[url=http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>Item]http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>Item not valid: The specified User was not found</faultstring><detail><axlError><axlcode>5007</axlcode><axlmessage>Item not valid: The specified User was not found</axlmessage><request>getUser</request></axlError></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
    2012-07-03 16:19:04,004 INFO  [http-8443-114] servletRouters.AXLFilter - Request 1335573937193 was process in 15ms
     
     
     
     
     

    Any ideas?
     
     
    One additional observation, it seems like any query that returns results works.  But anytime an error, such as no user found or no device found or any other erros simple retunrns a 500 internal server error.  Is thsi normal axl 8.5 behavior? I mean the same request will work if the user is found, but server returns 500 error if no user is found.  I would like to see the actual faultstring returned.   Is this possible using AXL 8.5?
     
     
     

    Subject: RE: AXL 8.5 getUser returns internal server error 500 when user cannot be f
    Replied by: David Staudt on 12-09-2012 10:38:10 AM
    Per the SOAP spec, HTTP 500 is the correct code for this situation:
     
    http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383529
     
    Testing on my 8.5 system, the 500 response includes the the SOAP response XML, including fault code:
     
    HTTP/1.1 500 Internal Server Error
    Set-Cookie: JSESSIONIDSSO=9E70ED32AB4A93A7135F62263F2F9E84; Path=/; Secure
    Set-Cookie: JSESSIONID=098FCCF3C12F4AAB596528AB9B9CBF9E; Path=/axl; Secure
    Content-Type: text/xml;charset=UTF-8
    Content-Length: 465
    Date: Wed, 12 Sep 2012 14:26:55 GMT
    Connection: close
    Server: 
     
    <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>Item not valid: The specified User was not found</faultstring><detail><axlError><axlcode>5007</axlcode><axlmessage>Item not valid: The specified User was not found</axlmessage><request>getUser</request></axlError></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>