AXL and PHP via SOAP - Not working... Error 5003

Version 1
    This document was generated from CDN thread

    Created by: Clark Milholland on 25-09-2009 06:10:15 PM
    Hello,
     
    I am trying to rebuild a Search Directory for the New version of CM 7.1.(2)
     
    I was running CM 4.0 and was able to Query with LDAP
     
    Well LDAP is no longer an option in CM 4.0
     
    I am trying to test with the Script they have in the wiki and it is not working....
     
    It is connecting and sending the SOAP request to the AXL service but AXL is responding with a 'No Handler found for parameters'
    Error
     
    Here is the RTMT Trace for the AXL service.
     
    2009-09-25 11:03:25,910 DEBUG [http-8443-3] axl.AXLRouter - Router: com.cisco.ccm.axl.AXLRouter@d14e7a
    2009-09-25 11:03:25,910 INFO  [http-8443-3] axl.AXLRouter - VERSION : "getUser"
    2009-09-25 11:03:25,910 INFO  [http-8443-3] axl.AXLRouter - sVERSION : 60
    2009-09-25 11:03:25,921 DEBUG [http-8443-3] axl.AXLRouter - addToCache("Administrator")
    2009-09-25 11:03:25,921 INFO  [http-8443-3] axl.AXLRouter - Received request 1253737392139 from Administrator at IP 10.66.14.200
    2009-09-25 11:03:25,921 INFO  [http-8443-3] axl.AXLRouter - <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><parameters><item><key>userid</key><value>7003</value></item></parameters></SOAP-ENV:Body></SOAP-ENV:Envelope>
    2009-09-25 11:03:25,934 DEBUG [http-8443-3] axl.AXLRouter - AXL_ENABLE_ENCODINGINFO: F; AXL_NAMESPACE: T
    2009-09-25 11:03:25,935 DEBUG [http-8443-3] axl.AXLRouter - Request is not a write request
    2009-09-25 11:03:25,935 DEBUG [http-8443-3] axl.AXLRouter - Successfully set the value of counter: 4 value: 0
    2009-09-25 11:03:25,935 ERROR [http-8443-3] axl.AXLRouter - com.cisco.ccm.axl.AXLRouter@d14e7a
    com.cisco.ccm.axl.DataValidationException: No Handler found for parameters
        at com.cisco.ccm.axl.HandlerFactory.getHandler(HandlerFactory.java:132)
        at com.cisco.ccm.axl.AXLRouter.onMessage(AXLRouter.java:886)
        at com.cisco.ccm.axl.AXLRouter.doPost(AXLRouter.java:293)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at sun.reflect.GeneratedMethodAccessor1087.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:244)
        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:276)
        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.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:568)
        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:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)
    2009-09-25 11:03:25,937 INFO  [http-8443-3] axl.AXLRouter - <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>No Handler found for parameters</faultstring><detail><axl:Error xmlns:axl="http://www.cisco.com/AXL/API/1.0"><axl:code>5003</axl:code><axl:message>No Handler found for parameters</axl:message><request>parameters</request></axl:Error></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
    2009-09-25 11:03:25,937 INFO  [http-8443-3] axl.AXLRouter - Request 1253737392139 was process in 27ms

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: David Staudt on 25-09-2009 07:24:37 PM
    It definitely seems like your code is not creating the right XML:
     

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
      <SOAP-ENV:Body>
        <parameters>
          <item>
            <key>userid</key>
            <value>7003</value>
          </item>
        </parameters>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
     
    A getUser request should look something like this:
     

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/7.0">
       <soapenv:Header/>
       <soapenv:Body>
          <ns:getUser sequence="1">
             <userid>dstaudt</userid>
          </ns:getUser>
       </soapenv:Body>
    </soapenv:Envelope>

     
    The wiki sample was run against PHP5 and php-soap 0.11.0.
     
    Can you provide your PHP code?

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: Clark Milholland on 25-09-2009 09:13:13 PM
    Yes here is the PHP Code I am running as a test.
     
    <?php
    $wsdl_url =
      "http://vinfo.ccc.lcl/ccphonestest.ccc.lcl/AXLAPI.wsdl";
             
    $client     = new SoapClient($wsdl_url,
                    array('trace'=>true,
                          'exceptions'=>true,
                          'location'=>"https://172.16.2.8:8443/axl/",
                          'login'=>'Administrator',
                          'password'=>'********!',
                           ));

       
    $var = $client->getUser(
                    array("userid"=>"7003")
    );
    print_r ($var);
       
       
    ?>
     
     
    Here is the wiki that is supposed to show you a sample
    http://developer.cisco.com/web/axl/wikidocs?src=/wiki/display/AXL/how-to_PHP#http://developer.cisco.com/wiki/display/AXL/how-to_PHP?
     
    And here is the PHP Soap Manaul
    http://us3.php.net/manual/en/soapclient.soapclient.php
     
    Any Ideas?

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: David Staudt on 25-09-2009 09:33:01 PM
    My only thought is that the HTTP location where you have the AXL wsdl either isn't reachable by the app, or does not contain the AXL wsdl at the indicated location.  I understand PHP will cache the wsdl by default for 1 day.
     
    The XML that is generated looks like some kind of default construct...
     
     

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: Clark Milholland on 25-09-2009 10:48:22 PM
    I can have it do a __getFunctions()
     
    and it will query the WDSL for all of the functions and return them right. I have Cacheing turned off in the php.ini file.
     
    Kinda at a loss but thanks for your help.

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: David Staudt on 26-09-2009 03:16:04 AM
    True...what does __getFunctions show?

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: David Staudt on 28-09-2009 07:00:30 PM
    Doing simply:


    $client = new SoapClient('/var/www/RisPort.wsdl',
                   array('trace'=>true,
                          'exceptions'=>true,
                          'location'=>'https://10.88.131.133:8443/realtimeservice/services/RisPort',
                          'login'=>'Administrator',
                          'password'=>'cisco!123',
                           )); //replace location/login/password with your local values

    print_r($client->__getFunctions());

     
    I get:
    Array
    (
        [0] => list(SelectCmDeviceResult $SelectCmDeviceResult, string $StateInfo) SelectCmDevice(string $StateInfo, CmSelectionCriteria $CmSelectionCriteria)
        [1] => list(string $StateInfo, SelectCtiItemResult $SelectCtiItemResult) SelectCtiItem(string $StateInfo, CtiSelectionCriteria $CtiSelectionCriteria)
        [2] => ArrayOfColumnValues ExecuteCCMSQLStatement(string $ExecuteSQLInputData, ArrayOfGetColumns $GetColumns)
        [3] => ArrayOfServerInfo GetServerInfo(ArrayOfHosts $Hosts)
        [4] => list(SelectCmDeviceResultSIP $SelectCmDeviceResultSIP, string $StateInfo) SelectCmDeviceSIP(string $StateInfo, CmSelectionCriteriaSIP $CmSelectionCriteriaSIP)
    )


    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: Clark Milholland on 28-09-2009 05:57:50 PM
    PHP-Soap has a built in function called __getFunctions. In basic it looks at the wsdl file and then returns all of the functions built into it. I am having a little bit of a crazy output from it but think it is just the WSDL file not having the descriptions in it.
    http://us.php.net/manual/en/soapclient.getfunctions.php
     
     
    Can any test the PHP on there system and see if it works? Or does any one know if it works?

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: Clark Milholland on 28-09-2009 08:47:37 PM
    Maybe you can make sense of something for me.
     
    I am using the AXLAPI and in your last example you used RISPort...
     
    I just did this
     
    $wsdl_url =
      "http://vinfo.ccc.lcl/ccphonestest.ccc.lcl/RisPort.wsdl";

    $client     = new SoapClient($wsdl_url,
                    array('trace'=>true,
                          'exceptions'=>true,
                          'location'=>"https://172.16.2.8:8443/realtimeservice/services/RisPort",
                          'login'=>'Administrator',
                          'password'=>'*******!',
                           ));

    print_r($client->GetServerInfo(array('server'=>'172.16.2.8')));

    ?>
     
    and it returned good data.
     
    Why is it that this worked but when I do something like
     
    <?php

    $wsdl_url =
      "http://vinfo.ccc.lcl/ccphonestest.ccc.lcl/AXLAPI.wsdl";

    $client     = new SoapClient($wsdl_url,
                    array('trace'=>true,
                          'exceptions'=>true,
                          'location'=>"https://172.16.2.8:8443/axl",
                          'login'=>'Administrator',
                          'password'=>'*******',
                           ));

    print_r($client->getUser(array('userid'=>'7003')));

    ?>
     
    I get
     
    Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] No
    Handler found for parameters in
    /var/www/ccphonestest.ccc.lcl/html/soaptest3.php:14
    Stack trace:
    #0 [internal function]: SoapClient->__call('getUser', Array)
    #1 /var/www/ccphonestest.ccc.lcl/html/soaptest3.php(14):
    SoapClient->getUser(Array)
    #2 {main} thrown in /var/www/ccphonestest.ccc.lcl/html/soaptest3.php on line 14
     
     
    Can I do the getUser information from RISport?
    should I be doing it this way?
    I guess I could use the SQL querys. Do you know of any documentation for the SQL querys?

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: David Staudt on 28-09-2009 10:12:37 PM
    All I can think is that the URL you have - http://vinfo.ccc.lcl/ccphonestest.ccc.lcl/AXLAPI.wsdl - does not contain the right wsdl.
     
    Are you grabbing the WSDL from the AXL SQL Toolkit under the "../AXL SQL Toolkit/schema/7.1/WSDL-AXIS" directory?

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: Clark Milholland on 28-09-2009 10:32:01 PM
    Yeah I am using that one... Will try some other stuff and let you know if I make any headway

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: Clark Milholland on 28-09-2009 11:17:29 PM
    Looks like that was the issue. I was grabbing the one off of the base dir on the axl sql toolkit.
     
    Now I am using the AXIS one and it is working great.
     
    Do you know if there is a wildcard option? Kinda off topic for this thread.

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: David Staudt on 29-09-2009 01:32:31 AM
    The AXL getUser request gets turned into an Informix (IDS) SQL query inside the service, so the search terms can contain the corresponding SQL wildcards.

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: Chandar vr on 29-09-2009 06:51:16 AM
    But even for other api's i too get the same error
     The Php code is
     1 
     2 $client = new SoapClient('https://ipadd:8443/realtimeservice/services/RisPort?wsdl',
     3                         array('trace'=>1,
     4                       'exceptions'=>1,
     5                       'location'=>"<a>[color=#336699]https://ipadd:8443/axl[/color]</a>]",
     6                       'login'=>'user',
     7                       'password'=>'pwd',
     8                        ));
     9 print "<pre>";
    10 print "Classes:  ";
    11 $var = $client->__getFunctions();
    12 print_r ($var);
    13 $response = $client->SelectCmDevice(array('CmSelectionCriteria'=>'unknown'));
    14 print_r ($response);
    15 

     1
     2Classes:    Array
     3 (
     4     [0] => list(SelectCmDeviceResult $SelectCmDeviceResult, string $StateInfo) SelectCmDevice(string $StateInfo, CmSelectionCriteria $CmSelectionCriteria)
     5     [1] => list(string $StateInfo, SelectCtiItemResult $SelectCtiItemResult) SelectCtiItem(string $StateInfo, CtiSelectionCriteria $CtiSelectionCriteria)
     6     [2] => ArrayOfColumnValues ExecuteCCMSQLStatement(string $ExecuteSQLInputData, ArrayOfGetColumns $GetColumns)
     7     [3] => ArrayOfServerInfo GetServerInfo(ArrayOfHosts $Hosts)
     8     [4] => list(SelectCmDeviceResultSIP $SelectCmDeviceResultSIP, string $StateInfo) SelectCmDeviceSIP(string $StateInfo, CmSelectionCriteriaSIP $CmSelectionCriteriaSIP)
     9 )
    10[b]Fatal error[/b]:  Uncaught SoapFault exception: [SOAP-ENV:Client] No Handler found for SelectCmDevice in path/a.php
    11Stack trace:
    12#0 [internal function]: SoapClient->__call('SelectCmDevice', Array)
    13#1 path/a.php(25): SoapClient->SelectCmDevice(Array)
    142 {main}
    15thrown in path/a.php on line [b]25[/b]

     
    Later i changed the code to reflect like the wsdl file from wsdl directory
     
     1
     2 $client = new SoapClient("/path/AXLAPI.wsdl",
     3                array('trace'=>0,
     4                       'exceptions'=>0,
     5                       'location'=>"<a>[color=#336699]https://ip:8443/axl[/color]</a>]",
     6                       'login'=>'uname',
     7                       'password'=>'pwd',
     8                        ));
     9 $var = $client->__getFunctions();
    10print_r ($var);

     
    But now i am getting this error
    [message:protected] => Function ("SelectCmDevice") is not a valid method for this service
     
    Please help me on this

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: David Staudt on 29-09-2009 01:45:51 PM
    So it looks like the SOAP library is reading the WSDL correctly, but it looks like it is not reaching the actual web service.  Looking at the 'location' value, you have: <a>https://ip:8443/axl</a>]
     
    I think there are extraneous <a> characters and a square close-bracket..?
     
    The location needs to be the live URL for the webservice, i.e.: https://ipadd:8443/realtimeservice/services/RisPort.  Assuming 'ipadd' either resolves to a real address via DNS, or it's getting replaced in your actual code with a valid IP.

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: Chandar vr on 29-09-2009 03:15:45 PM
    Sorry That is due to typo error..
     

     
    when i provide a live url i get the error No Handler found ............
     
    Please help me on this ..

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: David Staudt on 29-09-2009 04:03:20 PM
    Is the AXL service running?  What happens when you use a browser to visit https://ip:8443/axl?
     
    Can you check the actual XML request/response returned via:
     
    var_dump($client->__getLastRequest()); 
    var_dump($client->__getLastResponse());

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: Chandar vr on 02-10-2009 10:10:40 AM
    Hi
    I am getting NULL as the output when i print
     
    var_dump($client->__getLastRequest());
    var_dump($client->__getLastResponse());
     
    when i access this URL https://ip:8443/axl
     
    i get the landing page of the AXL [welcome etc...]

    Subject: RE: AXL and PHP via SOAP - Not working... Error 5003
    Replied by: David Staudt on 02-10-2009 12:51:58 PM
    That seems to indicate it never sends any XML to AXL.
     
    I'm pretty much of ideas, but just make sure there is no confusion about which service is which.  SelectCmDevice should be used with the Risport.wsdl and requests should be sent to https://ipadd:8443/realtimeservice/services/RisPorthttps://ip:8443/axl is used with the axlsoap.wsdl and only the AXL requests (e.g. getUser) work there.