At the moment I am building a (SOAP) connection with another system based on Call Templates. This works very well and it is an easy way to implement all the webservices the connection has to support.
But now I have to implement an webservice that is slightly different from the previous ones. Implementing this webservice makes it possible to upload documents to the system from Novulo.
I already created a test project for this Document webservice in SOAPui and that works. I can add an attachment in SOAPui and upload the file to the system. Now I am wondering if it possible to configure the connection with this Document webservice by using the call templates.
I know how to configure a call template process, the template itself and related exportdefinitions (request) and importdefinitions (response processing) etc.
But how do I configure a call template to make an request that includes an attachment?
Below is an example of a succesfull request from SOAPui, I added the attachment in SOAPui manually (see also SOAP Attachments and Files | SoapUI
The request example:
Thu Jul 04 15:48:59 CEST 2024: DEBUG: http-outgoing >>
POST /ExampleWebServices/services/DocumentWebservice HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/related; type="text/xml"; start="<rootpart@soapui.org>"; boundary="----=_Part_13_1100879049.1720100939741"
SOAPAction: ""
MIME-Version: 1.0
Content-Length: 2050
Host: wit.exampletest.nl
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.5 (Java/16.0.2)
------=_Part_13_1100879049.1720100939741
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <rootpart@soapui.org>
<soapenv:Envelope xmlns:gen="http://generic.webservice.common.example.nl " 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:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:UsernameToken wsu:Id="UsernameToken-token"><wsse:Username>USER</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Password</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">token==</wsse:Nonce><wsu:Created>2024-07-04T13:48:59.740Z</wsu:Created></wsse:UsernameToken></wsse:Security></soapenv:Header>
<soapenv:Body>
<gen:uploadDocument soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<documentWebservice xsi:type="example:DocumentWebservice" xmlns:eab="http://www.logicacmg.com/ExampleWebservices">
<dataHandler href="testbijlage.txt" xsi:type="example:DataHandler">1</dataHandler>
<description xsi:type="xsd:string">Voorbeeld</description>
<filename xsi:type="xsd:string">testbijlage.txt</filename>
</documentWebservice>
</gen:uploadDocument>
</soapenv:Body>
</soapenv:Envelope>
------=_Part_13_1100879049.1720100939741
Content-Type: text/plain; charset=us-ascii; name=testbijlage.txt
Content-Transfer-Encoding: 7bit
Content-ID: <testbijlage.txt>
Content-Disposition: attachment; name="testbijlage.txt"; filename="testbijlage.txt"
Test
------=_Part_13_1100879049.1720100939741--