Topic
10 replies Latest Post - ‏2013-01-26T21:54:48Z by Doyler86
Srikanth_EAI
Srikanth_EAI
12 Posts
ACCEPTED ANSWER

Pinned topic SOMA XML Interface - how to upload multiple files at the same time?

‏2009-12-03T18:39:27Z |
Hi,

I have a requirement to upload a bunch of files to Datapower through an automated process. I am trying to use SOMA to do it but looks like it supports only one file at a time. Is there a way to upload multiple files to Datapower using SOMA interface?

Thanks
Srikanth
Updated on 2013-01-26T21:54:48Z at 2013-01-26T21:54:48Z by Doyler86
  • swlinn
    swlinn
    1344 Posts
    ACCEPTED ANSWER

    Re: SOMA XML Interface - how to upload multiple files at the same time?

    ‏2009-12-03T19:13:48Z  in response to Srikanth_EAI
    You need to use the legacy soma uri. It will allow multiple requests like set-file operations at one time.

    Regards,
    Steve
    • swlinn
      swlinn
      1344 Posts
      ACCEPTED ANSWER

      Re: SOMA XML Interface - how to upload multiple files at the same time?

      ‏2009-12-03T19:19:09Z  in response to swlinn
      Just to be precise with my answer, the soma request is sent to https://dpapplname:5550/service/mgmt/2004. You can make this uri the default by selecting the SOAP Management URI checkbox in the XML Management Interface configuration. If not checked, the current schema supported by /service/mgmt/current is used if you do not specify a uri.

      Regards,
      Steve
      • Srikanth_EAI
        Srikanth_EAI
        12 Posts
        ACCEPTED ANSWER

        Re: SOMA XML Interface - how to upload multiple files at the same time?

        ‏2009-12-04T15:55:03Z  in response to swlinn
        That worked!!! Thanks Steve.

        The other thing I am currently struggling with is: How to roll back any changes made to a domain. I want to do a complete restore of a domain in case something fails during deployment. I tried the following

        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
        <soapenv:Body>
        <dp:request xmlns:dp="http://www.datapower.com/schemas/management">
        <dp:do-restore source-type="ZIP">
        <dp:input-file>Encoded-file</dp:input-file>
        <dp:domain name="Srikanth"/>
        </dp:do-restore>
        </dp:request>
        </soapenv:Body>
        </soapenv:Envelope>

        But this is working almost like an import and not deleting the objects/files which were added during failed deployment. Is there any way to get a complete restore of a domain from a previous working version?

        Thanks
        Srikanth
        • swlinn
          swlinn
          1344 Posts
          ACCEPTED ANSWER

          Re: SOMA XML Interface - how to upload multiple files at the same time?

          ‏2009-12-04T18:10:39Z  in response to Srikanth_EAI
          I've not done any work with them myself, but it sounds like you're asking about configuration checkpoints. Read up on them in the latest Administration Guide. I'm sure there is the ability in SOMA to checkpoint the current configuration and do a rollback if you have issues.

          Regards,
          Steve
  • SystemAdmin
    SystemAdmin
    6772 Posts
    ACCEPTED ANSWER

    Re: SOMA XML Interface - how to upload multiple files at the same time?

    ‏2011-04-13T19:29:14Z  in response to Srikanth_EAI
    Hi Srikanth,
    Will appreciate if u can post the soma script u r using for upload of multiple files at the same time.

    Regards
  • SystemAdmin
    SystemAdmin
    6772 Posts
    ACCEPTED ANSWER

    Re: SOMA XML Interface - how to upload multiple files at the same time?

    ‏2011-04-13T20:13:41Z  in response to Srikanth_EAI
    I tried this SOMA request..

    curl -k -u admin:passwd -d @mfile.xml https:datapowerIp:5550/service/mgmt/current
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    • <soapenv:Body>*
    • <dp:request domain="default" xmlns:dp="http://www.datapower.com/schemas/management">*
    • <dp:set-file name="local:///t.xml">base64_encoded</dp:set-file>*
    • <dp:set-file name="local:///t.xml">base64_encoded</dp:set-file>*
    • </dp:request>*
    • </soapenv:Body>*
    </soapenv:Envelope>
    But kept getting the internal error ..

    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><env:Fault><faultcode>env:Client</faultcode><faultstring>Internal Error (from client)</faultstring></env:Fault></env:Body></env:Envelope>

    But this script worked for me with no surprise..

    curl -k -u admin:passwd -d @mfile.xml https:datapowerIp:5550/service/mgmt/2004 (Legacy URL)

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    • <soapenv:Body>*
    • <dp:request domain="default" xmlns:dp="http://www.datapower.com/schemas/management">*
    • <dp:set-file name="local:///t.xml">base64_encoded</dp:set-file>*
    • <dp:set-file name="local:///t.xml">base64_encoded</dp:set-file>*
    • </dp:request>*
    • </soapenv:Body>*
    </soapenv:Envelope>

    hope this helps,

    Kumar
  • SystemAdmin
    SystemAdmin
    6772 Posts
    ACCEPTED ANSWER

    Re: SOMA XML Interface - how to upload multiple files at the same time?

    ‏2011-04-13T20:23:28Z  in response to Srikanth_EAI
    About the check point..

    Checkpoints are useful to test out different configurations with the possibility of going back to the original configuration. When you create a checkpoint it means that it creates a backup of the config file (no more).
    If anything fails here's what you need to know:
    The appliance has 2 configurations:

    Running configuration
    Persistent configuration
    The difference here is that when you make changes they happen to the running config until you save the configuration. If you reboot the appliance without saving the changes you will boot to the persistent configuration.

    If you want to test out some changes on the appliance you can create a checkpoint and the make the changes save them and try them out. If they do not work out or you want to go back just go the checkpoint menu where you can choose to roll back to the checkpoint you want. It will tell you what are the changes to the running configuration and you can choose to accept them or not.

    And SOMA for the checkpoint.

    <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:do-action>
    <SaveCheckpoint>
    <ChkName>myCheckpoint</ChkName>
    </SaveCheckpoint>
    </dp:do-action>
    </dp:request>
    </env:Body>
    </env:Envelope>
  • SystemAdmin
    SystemAdmin
    6772 Posts
    ACCEPTED ANSWER

    Re: SOMA XML Interface - how to upload multiple files at the same time?

    ‏2013-01-10T07:56:25Z  in response to Srikanth_EAI
    Hello Friends,

    I want to upload a file in DP box using soma script set-file option:

    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Body>
    <dp:request domain="POC" xmlns:dp="http://www.datapower.com/schemas/management">
    <dp:set-file name="local:///test.xml">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxsaWJyYXJ5Pg0KICAgIDxCb29rPmFiPC9Cb29rPg0KICAgIDxBdXRob3I+Y2Q8L0F1dGhvcj4NCiAgICA8Qm9vaz5hazwvQm9vaz4NCjwvbGlicmFyeT4=</dp:set-file>
    </dp:request>
    </env:Body>
    </env:Envelope>

    this is my curl command:
    curl --data-binary @Desktop/SetFile.xml -u dpuser:dppassword https://dphost:5550/service/mgmt/current -k
    error i am getting:

    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><e
    nv:Fault><faultcode>env:Client</faultcode><faultstring>Invalid SOAP envelope (fr
    om client)</faultstring></env:Fault></env:Body></env:Envelope>

    anyone please help!!

    regards,
    Abhinav
    • swlinn
      swlinn
      1344 Posts
      ACCEPTED ANSWER

      Re: SOMA XML Interface - how to upload multiple files at the same time?

      ‏2013-01-10T14:27:11Z  in response to SystemAdmin
      I copied your request into a file of my own and tried it and it worked:

      D:\eclipseworkspace\Test>curl --data-binary @ForumTestSoma1.xml -k -u swlinn:mypw https://myappliance.ibm.com:5550/service/mgmt/current
      <?xml version="1.0" encoding="UTF-8"?>
      <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><d
      p:response xmlns:dp="http://www.datapower.com/schemas/management"><dp:timestamp>
      2013-01-10T09:24:25-05:00</dp:timestamp><dp:result>OK</dp:result></dp:response><
      /env:Body></env:Envelope>

      Your file:
      <?xml version="1.0" encoding="UTF-8"?>
      <library>
          <Book>ab</Book>
          <Author>cd</Author>
          <Book>ak</Book>
      </library>
      


      The only thing I can think of is an issue with your XML Management Interface settings. What options do you have checked there? What firmware version are you using?

      Regards,
      Steve
      Updated on 2014-03-25T02:42:28Z at 2014-03-25T02:42:28Z by iron-man
      • Doyler86
        Doyler86
        91 Posts
        ACCEPTED ANSWER

        Re: SOMA XML Interface - how to upload multiple files at the same time?

        ‏2013-01-26T21:54:48Z  in response to swlinn
        Hello All,

        So did we confirm or Deny whether or not a Configuration Check Point places the file system back in the original state?

        thanks,

        Doyle