Soap message (multipart MIME message) with (+) attachment...

Discussion forum about all things Team Developer 7.x
Riuks
Estonia
Posts: 16
Joined: 10 Mar 2017, 07:41
Location: Tallinn, Estonia

Soap message (multipart MIME message) with (+) attachment...

Post by Riuks » 19 Sep 2019, 12:29

Hi
I have an issue with goverment soap: i need to send attatcment - binary data, something mystical MIME_boundary and so on. As far i undestand inside soap envelope is refference and binary data will transvered after soap envelope.
As far i understand right after envelope (not in xml , not between envelope tags) but my experience is only „inside envelope“ .

Right now i have no glue how to define this attachment part.

I also used wsdl-wizard and TD puts binary
<tdwsns:uploadMime
....
<tdwsns:request>
<tdwsns:target>KMD</tdwsns:target>
<tdwsns:operation>Submit</tdwsns:operation>
<tdwsns:file href="cid:refference">HERE</tdwsns:file>




Sample (Annex F):
.. other transport headers ...
Content-Type: multipart/related; type="text/xml"; start="<rootpart>"; boundary="MIME_boundary"
MIME-Version: 1.0

--MIME_boundary
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <rootpart>

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://producer.x-road.eu"
xmlns:xrd="http://x-road.eu/xsd/xroad.xsd"
xmlns:id="http://x-road.eu/xsd/identifiers">
<SOAP-ENV:Header>
<xrd:client id:objectType="SUBSYSTEM">
<id:xRoadInstance>EE</id:xRoadInstance>
<id:memberClass>GOV</id:memberClass>
<id:memberCode>MEMBER1</id:memberCode>
<id:subsystemCode>SUBSYSTEM1</id:subsystemCode>
</xrd:client>
<xrd:service id:objectType="SERVICE">
<id:xRoadInstance>EE</id:xRoadInstance>
<id:memberClass>GOV</id:memberClass>
<id:memberCode>MEMBER2</id:memberCode>
<id:subsystemCode>SUBSYSTEM2</id:subsystemCode>
<id:serviceCode>exampleService</id:serviceCode>
<id:serviceVersion>v1</id:serviceVersion>
</xrd:service>
<xrd:id>4894e35d-bf0f-44a6-867a-8e51f1daa7e0</xrd:id>
<xrd:userId>EE12345678901</xrd:userId>
<xrd:issue>12345</xrd:issue>
<xrd:protocolVersion>4.0</xrd:protocolVersion>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:exampleServiceSwaRef>
<exampleInput>foo</exampleInput>
<exampleAttachment>cid:data.bin</exampleAttachment>
</ns1:exampleServiceSwaRef>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

--MIME_boundary
Content-Type: application/octet-stream; name=data.bin
Content-Transfer-Encoding: base64
Content-ID: <data.bin>
Content-Disposition: attachment; name="data.bin"; filename="data.bin"

VGhpcyBpcyBhdHRhY2htZW50Lg0K
--MIME_boundary--

So, question :is multipart/mixed and swa supported somehow doable with TD soap reguest?
Hope someone knows , or at least any idea...


Riho

Additional info:

https://www.x-tee.ee/docs/live/xroad/pr ... ttachments :
2.4 Attachments
In case the message has attachments, it MUST be formatted as a multipart MIME message, with the SOAP request and its attachments being separate parts of the message. The SOAP request must be the first part. The resulting MIME message MUST be structured in accordance with the specification for SOAP messages with attachments [SOAPATT] and the request SOAP part's Content-Transfer-Encoding MIME header value MUST be "8bit". MIME headers of each part of the message are preserved without modification in the security server. For an example request that contains attachments see Annex F.
Additionally, MTOM-encoded [MTOM] messages are supported in the security server – the security server accepts MIME multipart messages where the content-type of the SOAP part is "application/xop+xml".

https://www.soapui.org/docs/soap-and-ws ... ments.html


http://axis.apache.org/axis2/java/core/ ... guide.html

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot], monchotgu and 0 guests