Topic
  • 2 replies
  • Latest Post - ‏2013-04-23T14:22:24Z by Harby
Harby
Harby
4 Posts

Pinned topic Sending multiple requests to DP via SOAP

‏2013-04-22T12:56:56Z |

I am using cURL to send a SOAP request to a Datapower device XI50. What I want to achive is to send one SOAP request and query two or more class attributes. 

-------------------------------------------------------This works-------------------------------------------------------

 

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<dp:request domain="dev_directory"
xmlns:dp="http://www.datapower.com/schemas/management">
<dp:get-status class="CPUUsage"/>
</dp:request>
</env:Body>
</env:Envelope>

-------------------------------------------------------------------------------------------------------------------------------

 

-------------------------------------------------------This does not work-------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<dp:request domain="dev_directory"
xmlns:dp="http://www.datapower.com/schemas/management">
<dp:get-status class="CPUUsage"/>
<dp:get-status class="MemoryStatus"/>
</dp:request>
</env:Body>
</env:Envelope>
 

I get the following error "Only one top level element is allowed in an XML document. Error processing resource"

 

 

 

Updated on 2013-04-22T13:05:30Z at 2013-04-22T13:05:30Z by Harby
  • swlinn
    swlinn
    1395 Posts
    ACCEPTED ANSWER

    Re: Sending multiple requests to DP via SOAP

    ‏2013-04-23T09:18:12Z  

    The legacy API supports this.  use https://yourappliance:5550/service/mgmt/2004 (or no URI at all if the first option in your XML Management Interface settings is checked which makes this the default URI).  Depending on the what you are trying to do, the legacy API is compatible.  Most new features however may not be supported, so you'll need to send those separately, but simple get-status, set-file, do-actions can be done in one request with the legacy API.

    Regards,

    Steve

  • swlinn
    swlinn
    1395 Posts

    Re: Sending multiple requests to DP via SOAP

    ‏2013-04-23T09:18:12Z  

    The legacy API supports this.  use https://yourappliance:5550/service/mgmt/2004 (or no URI at all if the first option in your XML Management Interface settings is checked which makes this the default URI).  Depending on the what you are trying to do, the legacy API is compatible.  Most new features however may not be supported, so you'll need to send those separately, but simple get-status, set-file, do-actions can be done in one request with the legacy API.

    Regards,

    Steve

  • Harby
    Harby
    4 Posts

    Re: Sending multiple requests to DP via SOAP

    ‏2013-04-23T14:22:24Z  
    • swlinn
    • ‏2013-04-23T09:18:12Z

    The legacy API supports this.  use https://yourappliance:5550/service/mgmt/2004 (or no URI at all if the first option in your XML Management Interface settings is checked which makes this the default URI).  Depending on the what you are trying to do, the legacy API is compatible.  Most new features however may not be supported, so you'll need to send those separately, but simple get-status, set-file, do-actions can be done in one request with the legacy API.

    Regards,

    Steve

    Thanks, that worked. I did the following

    curl -k -u USER:USERPASSWORD -d @c:\curl\getStatus.xml https://DataPower-Device:5550/service/mgmt/2004/current

     

    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Body>
    <dp:request domain="dev_directory"
    xmlns:dp="http://www.datapower.com/schemas/management">
    <dp:get-status class="CPUUsage"/>
    <dp:get-status class="MessageDurations"/>
    </dp:request>
    </env:Body>
    </env:Envelope>

    ------------------------------------------------------------------------------------------------------------------------------------------------------

    What I am trying to do now is to get the MessageDurations for each domain, I have tried the following, but with no luck

     

    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Body>
    <dp:request domain="default"
    xmlns:dp="http://www.datapower.com/schemas/management">
    <dp:get-status class="CPUUsage"/>
    </dp:request>
    <dp:request domain="dev_directory"
    xmlns:dp="http://www.datapower.com/schemas/management">
    <dp:get-status class="MessageDurations"/>
    </dp:request>
    <dp:request domain="dev_sales"
    xmlns:dp="http://www.datapower.com/schemas/management">
    <dp:get-status class="MessageDurations"/>
    </dp:request>
    </env:Body>
    </env:Envelope>