ESP dSeries Workload Automation

 View Only
  • 1.  Using SOAP Web Services

    Posted Nov 04, 2021 04:50 PM

    Are there any resources that exist that might provide more guidance on how to make use of the SOAP Web Services with dSeries?  Start to Finish examples don't appear to exist in the large PDF document for the Scheduler.  There appear to be about 30-40 pages about what functions are available, but no information about how to authenticate with it.  It seems to set out to provide an example for how to do this with a Spreadsheet Application.  It diagrams it, but provides no real details.

    Am I missing something?  Has anyone ever gotten this to work that can point me in the right direction?

    Thanks



  • 2.  RE: Using SOAP Web Services

    Broadcom Employee
    Posted Nov 05, 2021 01:32 PM
    Hi,
    DE WebService uses BASIC authentication.  Here is an example from SoapUI app.  Check your application on how to define authentication header.  The user/pass you define is the DE user that you would use to login (e.g. in Desktop Client).



    HTH,
    Nitin Pande

    ------------------------------
    Support
    Broadcom
    Toronto
    ------------------------------



  • 3.  RE: Using SOAP Web Services

    Posted Nov 05, 2021 04:27 PM
    Knowing that it uses BASIC authentication helps a great deal.  I was able to get this to work in using Python standard libraries.

    For posterity's sake, I will provide the community with that code in hopes that helps someone down the line... because

    import http.client
    import ssl
    import base64
    
    # username and password of account with required permissions
    username = "##redacted##"
    password = "##redacted##"
    
    # build the base64 encode credentials string used for HTTP Basic Authentication
    credentials = base64.b64encode("{username}:{password}".format(username=username, password=password).encode()).decode("ascii")
    
    # Hostname and port where the EspDSeriesService is located
    host = "##redacted##"
    port = 0000
    context = ssl.SSLContext()
    
    # This connection test does NOT verify TLS cert presented by host
    # This configuration should *not* be used in production
    conn = http.client.HTTPSConnection(host, port=port, context=context)
    
    # SOAP requires Content-type: text/xml
    # Credentials are passed in HTTP request headers for BASIC Authentication
    http_head = {'Content-type': 'text/xml',
                 'Authorization': 'Basic %s' % credentials }
    
    # SOAP Message gets passed as HTTP request body
    # Example taken from documentation 
    # https://techdocs.broadcom.com/us/en/ca-enterprise-software/intelligent-automation/ca-workload-automation-de/12-1/utilities-and-soap-web-services-functions/ca-wa-soap-web-services/event-web-services-functions.html
    # xmlns:soap modified due to Version mismatch per https://stackoverflow.com/questions/26233636/
    http_body = """
    <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://webservice.engine.wa.ca.com/xsd">
       <soap:header></soap:header>
       <soap:body>
          <xsd:listeventschedule>
             <!--Optional:-->
             <xsd:eventnamefilter>SCHEDMASTER.VERIFY</xsd:eventnamefilter>
             <!--Optional:-->
             <xsd:from>now</xsd:from>
             <!--Optional:-->
             <xsd:to>now plus 1 day</xsd:to>
             <!--Optional:-->
             <xsd:count>10</xsd:count>
          </xsd:listeventschedule>
       </soap:body>
    """
    
    conn.request('POST', '/axis2/services/EspDSeriesService?wsdl', http_body, http_head)
    resp = conn.getresponse()
    print(resp.read().decode())