6 Replies Latest reply on Feb 4, 2016 8:53 PM by Ashish Vijay

    Use of webservices in Bladelogic to run blcli commands

    Ashish Vijay

      Hello,

       

      I am creating some python code to run some blcli command with help of web services.

       

              client.set_options(location='https://hostname:9843/services/LoginService?wsdl', cache=None)

              result = client.service.loginUsingSessionCredential('/home/Ashish.Vijay/.bladelogic/bl_sesscc')

       

      When i use "client.service.loginUsingUserCredential", i am able to connect to BL App Server but i want to use session credentials to connect so when i use "client.service.loginUsingSessionCredential", it failed to connect to app server. Below is return error message.

       

      DEBUG:suds.client:headers = {'SOAPAction': u'"bladelogicNamespace:loginUsingSessionCredential"', 'Content-Type': 'text/xml; charset=utf-8'}

      ERROR:suds.client:<?xml version="1.0" encoding="UTF-8"?>

      <SOAP-ENV:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://bladelogic.com/webservices/skeleton/login" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

         <SOAP-ENV:Header/>

         <ns0:Body>

            <ns1:loginUsingSessionCredential>

               <ns1:ws_sessionCredential>/home/Ashish.Vijay/.bladelogic/bl_sesscc</ns1:ws_sessionCredential>

            </ns1:loginUsingSessionCredential>

         </ns0:Body>

      </SOAP-ENV:Envelope>

      DEBUG:suds.client:http failed:

      <?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>unknown</faultstring><detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>

      Server raised fault: 'unknown'

      (Fault){

         faultcode = "soapenv:Server"

         faultstring = "unknown"

         detail = ""

      }

       

       

       

      Can someone tell me how to use loginUsingSessionCredential to connect to app server.