Forum Discussion

CLewis's avatar
CLewis
Occasional Contributor
15 years ago

Insert file as base64 into request

We have some webserivces that accept base64 binary files in the request. Ideally we'd like a way to insert files, converted to base64, at specified position within the request. I am not aware of a current way to do this in soap-ui.

    So, I wrote the functionality to do this, adding a new option to the right click window in the request editor pane. I'd be more than happy to contribute this back(I previously provided the Response SLA assertion).

  Ole, let me know if you(or anyone else) is interested, and the best way to do so. I don't remember how we did it before.

Thanks,
Cory

4 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Cory!

    sounds great! The existing "file:" insertion mechanism in binary fields should work also (ie if you put file: into an element that is either base64 or hexBinary, soapUI should insert the file in the right format), but I would be happy to add this to the editor menu.. easiest is if you mail us the code (support@eviware.com) or attache it here.. alternatively I can set up svn access for you so you can commit the changes yourself.. let me know whatever suits you best!

    best regards!

    /Ole
    eviware.com
  • CLewis's avatar
    CLewis
    Occasional Contributor
    I figured there was probably some way to do it - learn something every day.

    In any case I will email you the code - feel free to review and improve as necessary, or ignore all together. Currently it inserts the file at the cursor, I'm not sure if this is ideal or not.

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

    this code is in the 3.0.1 release, great thanks for contributing!

    regards,

    /Ole
    eviware.com