XMLA/SOAP command from a bash shell

前端 未结 1 1768
滥情空心
滥情空心 2021-01-25 09:26

I need to call the management API from icCube from withing a bash shell. What is the easiest way for sending a SOAP command like :

    

        
1条回答
  •  时光说笑
    2021-01-25 10:10

    Perl sample available in documentation : http://www.iccube.com/support/documentation/user_guide/using/cube_management.php (in the end of document).

    Curl basic auth handled using '--user' argument

    Bash sample:

      #!/bin/bash
    
      URL="http://localhost:8282/icCube/xmla"
      COMMAND="LIST_SCHEMA"
    
      echo ${COMMAND}
    
      curl --header "Content-Type: text/xml;charset=UTF-8" \
      --header "SOAPAction:urn:schemas-microsoft-com:xml-analysis#Execute" \
      --user admin:admin --data @- ${URL} <
        
          
        
          
              ${COMMAND}
          
        
          
      
      EOF
    

    Note: Make sure there isn't any whitespace after the closing EOF or the API will return a SOAP syntax error.

    0 讨论(0)
提交回复
热议问题