3 Replies Latest reply on Jan 16, 2020 6:05 AM by Carl Wilson

    Utilizing attachments tag in Web_Service:Make SOAP Request Method One

    Alexander Foldats
      Share This:

      Hello,

       

      In a soap request that I am constructing I need to send a file as an attachment to update an Incident in Service Manager. I have done this call using SoapUI and am able to do it correctly. When I then utilize the out of the BOX Make SOAP Request Method One to do the same exact call I am running into errors and can only assume I am using the attachments input incorrectly. if anyone can help it would be much appreciated.

       

      This is the request I send:

       

      <request-data>

        <soap-rpc-request>

          <use-ssl-certificate>false</use-ssl-certificate>

          <install-certificate>false</install-certificate>

          <allow-unsigned-certificate>false</allow-unsigned-certificate>

          <passphrase>****MASKED****</passphrase>

          <http-connection-properties>

            <SoapAction>Update</SoapAction>

            <Content-Type>text/xml;charset=UTF-8</Content-Type>

          </http-connection-properties>

          <username>interfaz_BMC</username>

          <password>****MASKED****</password>

          <transport>http-rpc</transport>

          <soap-url>http://led1sma2.es.wcorp.carrefour.com:13095/SM/7/WSDL_BMC_AUTO.wsdl</soap-url>

          <character-set />

          <download-attachments>false</download-attachments>

          <soap-message>

            <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://schemas.hp.com/SM/7" xmlns:com="http://schemas.hp.com/SM/7/Common" xmlns:xm="http://www.w3.org/2005/05/xmlmime">

              <soapenv:Header />

              <soapenv:Body>

                <ns:UpdateIncident_BMCRequest attachmentInfo="true" attachmentData="true" ignoreEmptyElements="true" updateconstraint="-1">

                  <ns:model query="">

                    <ns:keys query="" updatecounter="">

                      <!--Optional:-->

                      <ns:Incidencia type="String" mandatory="" readonly="">IM1124393</ns:Incidencia>

                    </ns:keys>

                    <ns:instance query="" uniquequery="" recordid="" updatecounter="">

                      <ns:attachments>

                        <!--Zero or more repetitions:-->

                        <com:attachment href="cid:W0908LIN1664_RTPA_RESULTS.xlsx" name="W0908LIN1664_RTPA_RESULTS.xlsx" action="add" />

                      </ns:attachments>

                    </ns:instance>

                    <!--Optional:-->

                    <ns:messages>

                      <!--Zero or more repetitions:-->

                      <com:message type="String" mandatory="" readonly="" severity="" module="" />

                    </ns:messages>

                  </ns:model>

                </ns:UpdateIncident_BMCRequest>

              </soapenv:Body>

            </soapenv:Envelope>

          </soap-message>

          <attachments>

            <attachment>

              <file>/tmp/oraclelocks/W0908LIN1664_RTPA_RESULTS.xlsx</file>

              <content-id>W0908LIN1664_RTPA_RESULTS.xlsx</content-id>

            </attachment>

          </attachments>

        </soap-rpc-request>

      </request-data>

       

      and the response:

       

      <soap-response>

        <metadata>

          <status>success</status>

        </metadata>

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

          <SOAP-ENV:Body>

            <SOAP-ENV:Fault>

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

              <faultstring>A CXmlApiException was raised in native code : error 2 : scxmlapi(2) - No method supplied</faultstring>

              <faultactor>Server</faultactor>

            </SOAP-ENV:Fault>

          </SOAP-ENV:Body>

        </SOAP-ENV:Envelope>

      </soap-response>

       

      Following best I could on the documentation I filled the input of attachments with the location of the file and set the content id tag with the name of the file:

       

       

      in Soap UI of course it was attached manually:

       

       

      The file exists on the Redhat Machine where the peer is ran, I made sure of that. Any ideas? am i creating the attachments tag incorrectly?

       

      Regards,

       

      Alex