IT Process Automation

Expand all | Collapse all

How to run importObject() API by SOAPUI?

Jump to Best Answer
  • 1.  How to run importObject() API by SOAPUI?

    Posted 04-08-2016 08:42 AM

    Hi Everyone!

     

    I want to import a package to CA PAM using importObject() API and run by SOAPUI  like this:

    but when run it  I get a message error below:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

       <SOAP-ENV:Header/>

       <SOAP-ENV:Body>

          <SOAP-ENV:Fault>

             <faultcode>SOAP-ENV:Client</faultcode>

             <faultstring>Unable to retrieve the specified attachment.</faultstring>

          </SOAP-ENV:Fault>

       </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

     

    Could you give me advise in this case ?

     

    Thank you so much



  • 2.  Re: How to run importObject() API by SOAPUI?
    Best Answer

    Posted 04-11-2016 05:19 PM

    Hi,

     

    I believe your SOAP code is not the problem, the documentation seems to be a little confusing about the use of the localsourcelocation.

    From what I can tell, it does not seem to be (as one would assume at first) the path to the file on the CAPA server when using it from any other tool than the CAPA Invoke_SOAP_Method.

     

    I was able to get the following code to work in SoapUI by actually attaching the file as a MIME attachment, as seems to be stated in the documentation.

    If you are using the Invoke_SOAP_Method, you can set the file name in the MIME Attachment tab, otherwise I believe you will have to use platform-specific method to attach the file to the SOAP body.

     

    I have attached an example from SOAPui.

     

    Hope this helps,

    Ian

     

    Here is the "original" SOAP XML body:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:itp="http://www.ca.com/itpam">

      <soapenv:Header/>

      <soapenv:Body>

          <itp:importFileParam>

            <itp:auth>

                <itp:user>USERNAME</itp:user>

                <itp:password>PASSWORD</itp:password>

            </itp:auth>

            <itp:importLocation>/Sandbox/IanSBX/Tmp Stuff/</itp:importLocation>

            <itp:isSetCurrent>true</itp:isSetCurrent>

            <itp:isMakeAvailable>true</itp:isMakeAvailable>

            <itp:overwriteAction>incrementObjectVersion</itp:overwriteAction>

          </itp:importFileParam>

      </soapenv:Body>

    </soapenv:Envelope>

     

    Here is the raw SOAP after I've attached the XML (in the SOAPui GUI):

     

    POST https://automation.***.***/itpam/soap HTTP/1.1

    Accept-Encoding: gzip,deflate

    Content-Type: multipart/related; type="text/xml"; start="<rootpart@soapui.org>"; boundary="----=_Part_4_832313225.1460408537647"

    SOAPAction: "importObject"

    MIME-Version: 1.0

    Content-Length: 25244

    Host: automation-dev.***.***

    Connection: Keep-Alive

    User-Agent: Apache-HttpClient/4.5.1 (Java/1.8.0_66)

     

     

     

     

    ------=_Part_4_832313225.1460408537647

    Content-Type: text/xml; charset=UTF-8

    Content-Transfer-Encoding: 8bit

    Content-ID: <rootpart@soapui.org>

     

     

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:itp="http://www.ca.com/itpam">

      <soapenv:Header/>

      <soapenv:Body>

          <itp:importFileParam>

            <itp:auth>

                <itp:user>USERNAME</itp:user>

                <itp:password>PASSWORD</itp:password>

            </itp:auth>

            <itp:importLocation>/Sandbox/IanSBX/Tmp Stuff/</itp:importLocation>

            <itp:isSetCurrent>true</itp:isSetCurrent>

            <itp:isMakeAvailable>true</itp:isMakeAvailable>

            <itp:overwriteAction>incrementObjectVersion</itp:overwriteAction>

          </itp:importFileParam>

      </soapenv:Body>

    </soapenv:Envelope>

    ------=_Part_4_832313225.1460408537647

    Content-Type: text/xml; charset=Cp1252; name="Empty Process.xml"

    Content-Transfer-Encoding: binary

    Content-ID: <Empty>

    Content-Disposition: attachment; name="Empty Process.xml"; filename="Empty Process.xml"

     

     

    <?xml version="1.0" encoding="UTF-8"?>

    <C2OList><DocXML>&lt;?xml version="1.0" encoding="UTF-8"?&gt;

    &lt;C2OObject&gt;&lt;Workflow isContentNonModifiable="false" IsLockMetadata="false" isRunAsOwner="false" isSLAEnable="false"&gt;&lt;ReferenceName&gt;Empty Process&lt;/ReferenceName&gt;&lt;C2OVersionSet isBaseLine="false" current="true" c2OVersionCount="0"&gt;&lt;objectID&gt;0&lt;/objectID&gt;&lt;owner&gt;******&lt;/owner&gt;&lt;lastModifiedBy&gt;******&lt;/lastModifiedBy&gt;&lt;versionID&gt;0&lt;/versionID&gt;&lt;DateCreated&gt;2016-04-11T16:56:07.231-04:00&lt;/DateCreated&gt;&lt;DateModified&gt;2016-04-11T16:56:20.793-04:00&lt;/DateModified&gt;&lt;releaseNumber&gt;&lt;/releaseNumber&gt;&lt;solutionName&gt;&lt;/solutionName&gt;&lt;/C2OVersionSet&gt;&lt;C2OKeywordSet c2-oKeyword-count="0"&gt;&lt;reference-type&gt;Flowchart&lt;/reference-type&gt;&lt;reference-path&gt;Empty Process&lt;/reference-path&gt;&lt;OID&gt;4229&lt;/OID&gt;&lt;ref-iD&gt;5359&lt;/ref-iD&gt;&lt;reference-name&gt;Empty Process&lt;/reference-name&gt;&lt;/C2OKeywordSet&gt;&lt;ReferencePath&gt;Empty Process&lt;/ReferencePath&gt;&lt;IsDeleted&gt;false&lt;/IsDeleted&gt;&lt;CheckedOutBy&gt;&lt;/CheckedOutBy&gt;&lt;CurrentVersionID&gt;0&lt;/CurrentVersionID&gt;&lt;ReferenceType&gt;Flowchart&lt;/ReferenceType&gt;&lt;OID&gt;0&lt;/OID&gt;&lt;DisplayName&gt;Empty Process&lt;/DisplayName&gt;&lt;Owner&gt;******&lt;/Owner&gt;&lt;Description&gt;&lt;/Description&gt;&lt;DocumentType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="java:java.lang.String"&gt;Flowchart&lt;/DocumentType&gt;&lt;State&gt;UnLocked&lt;/State&gt;&lt;Version&gt;0&lt;/Version&gt;&lt;CreationDate&gt;2016-04-11T16:56:07.231-04:00&lt;/CreationDate&gt;&lt;ModifiedDate&gt;2016-04-11T16:56:20.793-04:00&lt;/ModifiedDate&gt;&lt;minAge&gt;-1&lt;/minAge&gt;&lt;minFailed&gt;-1&lt;/minFailed&gt;&lt;minRecent&gt;-1&lt;/minRecent&gt;&lt;isImported&gt;false&lt;/isImported&gt;&lt;isExported&gt;false&lt;/isExported&gt;&lt;isForCheckin&gt;false&lt;/isForCheckin&gt;&lt;isSaveOverride&gt;true&lt;/isSaveOverride&gt;&lt;HostName&gt;76b49d1a-3697-4186-990e-346821d4783b&lt;/HostName&gt;&lt;tempDocModifiedDate&gt;2016-04-11T16:56:17.121-04:00&lt;/tempDocModifiedDate&gt;&lt;isForceFullySave&gt;false&lt;/isForceFullySave&gt;&lt;Orchestrator&gt;automation-dev.***.***&lt;/Orchestrator&gt;&lt;WfDataset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="vmap"&gt;&lt;const&gt;&lt;readonly/&gt;&lt;/const&gt;&lt;vmconst iskeyval="false"/&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;TouchpointName&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cstring issysvar="true"&gt;&lt;value&gt;&lt;/value&gt;&lt;strconst max="2147483647" canbeblank="true" isjavacode="false" noOflines="0"&gt;&lt;default&gt;&lt;/default&gt;&lt;/strconst&gt;&lt;/cstring&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;ServerName&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cstring issysvar="true"&gt;&lt;value&gt;&lt;/value&gt;&lt;strconst max="2147483647" canbeblank="true" isjavacode="false" noOflines="0"&gt;&lt;default&gt;&lt;/default&gt;&lt;/strconst&gt;&lt;/cstring&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;ServerId&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cstring issysvar="true"&gt;&lt;value&gt;&lt;/value&gt;&lt;strconst max="2147483647" canbeblank="true" isjavacode="false" noOflines="0"&gt;&lt;default&gt;&lt;/default&gt;&lt;/strconst&gt;&lt;/cstring&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;DisplayName&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cstring issysvar="true"&gt;&lt;value&gt;&lt;/value&gt;&lt;strconst max="2147483647" canbeblank="true" isjavacode="false" noOflines="0"&gt;&lt;default&gt;&lt;/default&gt;&lt;/strconst&gt;&lt;/cstring&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;InstanceUUID&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cstring issysvar="true"&gt;&lt;value&gt;&lt;/value&gt;&lt;strconst max="2147483647" canbeblank="true" isjavacode="false" noOflines="0"&gt;&lt;default&gt;&lt;/default&gt;&lt;/strconst&gt;&lt;/cstring&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;rootUUID&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cstring issysvar="true"&gt;&lt;value&gt;&lt;/value&gt;&lt;strconst max="2147483647" canbeblank="true" isjavacode="false" noOflines="0"&gt;&lt;default&gt;&lt;/default&gt;&lt;/strconst&gt;&lt;/cstring&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;CallerUser&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cstring issysvar="true"&gt;&lt;value&gt;&lt;/value&gt;&lt;strconst max="2147483647" canbeblank="true" isjavacode="false" noOflines="0"&gt;&lt;default&gt;&lt;/default&gt;&lt;/strconst&gt;&lt;/cstring&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;effectiveUser&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cstring issysvar="true"&gt;&lt;value&gt;&lt;/value&gt;&lt;strconst max="2147483647" canbeblank="true" isjavacode="false" noOflines="0"&gt;&lt;default&gt;&lt;/default&gt;&lt;/strconst&gt;&lt;/cstring&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;RuntimeROID&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cstring issysvar="true"&gt;&lt;value&gt;&lt;/value&gt;&lt;strconst max="2147483647" canbeblank="true" isjavacode="false" noOflines="0"&gt;&lt;default&gt;&lt;/default&gt;&lt;/strconst&gt;&lt;/cstring&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;InstanceName&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cstring issysvar="true"&gt;&lt;value&gt;&lt;/value&gt;&lt;strconst max="2147483647" canbeblank="true" isjavacode="false" noOflines="0"&gt;&lt;default&gt;&lt;/default&gt;&lt;/strconst&gt;&lt;/cstring&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;ParentProcessROID&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cstring issysvar="true"&gt;&lt;value&gt;&lt;/value&gt;&lt;strconst max="2147483647" canbeblank="true" isjavacode="false" noOflines="0"&gt;&lt;default&gt;&lt;/default&gt;&lt;/strconst&gt;&lt;/cstring&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;RootProcessROID&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cstring issysvar="true"&gt;&lt;value&gt;&lt;/value&gt;&lt;strconst max="2147483647" canbeblank="true" isjavacode="false" noOflines="0"&gt;&lt;default&gt;&lt;/default&gt;&lt;/strconst&gt;&lt;/cstring&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;ScheduledStartTime&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cdate issysvar="true"&gt;&lt;dateconst&gt;&lt;mask default="true"&gt;&lt;value&gt;MM/dd/yyyy&lt;/value&gt;&lt;/mask&gt;&lt;/dateconst&gt;&lt;/cdate&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;StartDate&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cdate issysvar="true"&gt;&lt;dateconst date="true"&gt;&lt;mask default="true"&gt;&lt;value&gt;MM/dd/yyyy&lt;/value&gt;&lt;/mask&gt;&lt;/dateconst&gt;&lt;/cdate&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;StartTime&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cdate issysvar="true"&gt;&lt;dateconst time="true"&gt;&lt;mask default="true"&gt;&lt;value&gt;MM/dd/yyyy&lt;/value&gt;&lt;/mask&gt;&lt;/dateconst&gt;&lt;/cdate&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;EndDate&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cdate issysvar="true"&gt;&lt;dateconst date="true"&gt;&lt;mask default="true"&gt;&lt;value&gt;MM/dd/yyyy&lt;/value&gt;&lt;/mask&gt;&lt;/dateconst&gt;&lt;/cdate&gt;&lt;/field&gt;&lt;field isstdpar="false" hidefromoutput="false"&gt;&lt;name&gt;EndTime&lt;/name&gt;&lt;display&gt;&lt;page&gt;System&lt;/page&gt;&lt;/display&gt;&lt;cdate issysvar="true"&gt;&lt;dateconst time="true"&gt;&lt;mask default="true"&gt;&lt;value&gt;MM/dd/yyyy&lt;/value&gt;&lt;/mask&gt;&



  • 3.  Re: How to run importObject() API by SOAPUI?

    Posted 04-12-2016 11:55 PM

    Hi Ian Rich,

     

    Thanks for your answer, I solved my issues

     

    best & regards