Forum Discussion

Mirjana's avatar
Mirjana
New Contributor
9 years ago

Attachment returned in SOAP Response has size -1 and throws nullpointer exception when downloading

Hi,

 

When I have SOAP method that add Attachment into SOAP Response, that attachment is visible in SOAP UI but cannot be downloaded. It shows size -1 and when trying to download it throws java.langNullPointer exception.

 

The same issue happens with SOAP UI as well as Ready trial version that I downloaded for that test only.

 

Thanks!

 

Kind regards,

Mirjana

3 Replies

  • kondasamy's avatar
    kondasamy
    Regular Contributor

    Could you please post the raw response here!

     

    Thanks,

    Kondasamy

    • Mirjana's avatar
      Mirjana
      New Contributor

      Hi,

       

      Thanks for the answer.

      Please find the raw response below:

       

      HTTP/1.1 200 OK
      Date: Mon, 22 Aug 2016 05:21:11 GMT
      content-type: multipart/related; boundary="_=5028001134305888Sterling5028001134305888MOKO"; type="text/xml"
      Content-Length: 961
      Date: Mon, 22 Aug 2016 05:21:12 GMT
      Server: Jetty(6.1.26)

      --_=5028001134305888Sterling5028001134305888MOKO
      content-type: text/xml; charset=UTF-8
      content-id: <RHEL6:node1:156a3c77c2e:3956586>

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
      <WSResponse>Success</WSResponse>
      <mesa:attachment xmlns:mesa="http://www.sterlingcommerce.com/mesa" href="cid:attachment=1045859254_1471843272065@sterlingcommerce.com"></mesa:attachment>
      </soapenv:Body>
      </soapenv:Envelope>

      --_=5028001134305888Sterling5028001134305888MOKO
      content-type: application/octet-stream
      content-id: <attachment=1045859254_1471843272065@sterlingcommerce.com>

      <quer:Query_MIR xmlns:quer="http://www.ecom.hk/QuerySelect_MIR">
      <QueryStatement>?</QueryStatement>
      <param1>?</param1>
      <param2>?</param2>
      </quer:Query_MIR>
      --_=5028001134305888Sterling5028001134305888MOKO--

       

      Kind regards,

      Mirjana

      • kondasamy's avatar
        kondasamy
        Regular Contributor

        If we see the raw response, I can see the attachment part which is not complete and hence SoapUI is returning the size as -1.

         

        --_=5028001134305888Sterling5028001134305888MOKO
        content-type: application/octet-stream
        content-id: <attachment=1045859254_1471843272065@sterlingcommerce.com>
        <quer:Query_MIR xmlns:quer="http://www.ecom.hk/QuerySelect_MIR">
        <QueryStatement>?</QueryStatement>
        <param1>?</param1>
        <param2>?</param2>
        </quer:Query_MIR>
        --_=5028001134305888Sterling5028001134305888MOKO--

        I would recommend you to reach your developers to return valid data in the attachments.

         

        Thanks,

        Kondasamy