Forum Discussion

SiKing's avatar
SiKing
Community Expert
11 years ago

[Resolved] problems with attachments

Hello.
I am having a problem with attachments. Following the guide here.
I have two different SOAP calls that both use attachments, in both cases it is the same thing: base64 encoding. For one of my calls everything works just as described, for the other call the attachment never gets encoded. When I look in the Raw Request, I see something like (cut for brevity!):
<ImageBytes><![CDATA[����??JFIF??????????��?>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality
��?C??????????? ?

I tried using both the cid: notation as well as the file: inline - same thing: one works, one does not. In all cases I made sure that I have the Encode Attachments = true.
Where else do I look? What could be causing this?
TIA.

6 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    For the SOAP Request that works are you sending an image (.jpg file) as an attachment as well?

    Are there some differences in the RAW request shown between the one that works, and doesn't work such as SOAP headers, different SOAP header values?

    Are you using MTOM to send the attachments?


    Regards,
    Marcus
    SmartBear Support
  • SiKing's avatar
    SiKing
    Community Expert
    In all cases I am using the same file, an image. I did try other file types just for the heck of it, with same results.
    In all cases MTOM is disabled, although I tried enabling this just to see if anything changes - no change. The application accepts the attachments as base64 encoded inline, same as the first example in the linked documentation in my first post.
    The headers are similar, I do not see any obvious difference.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    Can you check the WSDL of the request that is failing to see if has type xsd:base64Binary for the element <ImageBytes>?

    Is it possible for you to share your WSDL file?

    I don't know why one request would work and the other wouldn't if there the same, so it could be some differences in the WSDL files for them as one request attachment content is not properly encoded inline.


    Regards,
    Marcus
    SmartBear Support
  • SiKing's avatar
    SiKing
    Community Expert
    That was the first thing I thought of! Both of them are defined the same: base64binary. That is why this seems so very odd.
    Would you prefer the WSDLs or a project.xml?
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Yes, please attach the project.xml file.



    Regards,
    Marcus
    SmartBear Support
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    The problem was the prefix was missing from one of the parent elements in which the child node element had the encoded image.



    Regards,
    Marcus
    SmartBear Support