Skip to Main Content

General Cloud Infrastructure

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Upload an attachment

3831643Apr 25 2023

I trying to create a SOAP to upload attachment to an item.

I'm using the https://<server>/idcws/GenericSoapPort service, but I keep getting 415 Unsupported Media Type.

I've tried to upload a test image (jpg and png), below is the template I'm using. Any help would be greatly appreciated

<soap:Envelope 
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:ucm="http://www.oracle.com/UCM">
	<soap:Header>
		<wsse:Security soap:mustUnderstand="true" 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">
			<wsu:Timestamp>
				<wsu:Created>2023-04-25T01:23:17.528Z</wsu:Created>
				<wsu:Expires>2023-04-26T23:23:17.528Z</wsu:Expires>
			</wsu:Timestamp>
			<wsse:UsernameToken wsu:Id="UsernameToken-10A35E566620F7DCD515652775157183">
				<wsse:Username>?</wsse:Username>
				<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">?</wsse:Password>
				<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">yYKK1Kz/AIytEzB50ZK9uw==</wsse:Nonce>
				<wsu:Created>2023-04-25T01:23:17.718Z</wsu:Created>
			</wsse:UsernameToken>
		</wsse:Security>
   </soap:Header>
<soap:Body>
    <ucm:GenericRequest webKey="cs">
        <ucm:Service IdcService="CHECKIN_NEW">
            <ucm:Document>
                <ucm:Field name="dSecurityGroup">Attachments</ucm:Field>
                <ucm:Field name="dDocType">Document</ucm:Field>
                <ucm:Field name="dDocAccount" /><!-- scm$/item$/import$- -->
                <ucm:Field name="dDocName">TestImg_001</ucm:Field>
                <ucm:Field name="dDocTitle">TestImg_001.jpg</ucm:Field>
                <ucm:File href="TestImg_001.jpg" name="primaryFile">
                    <ucm:Contents>{Base64 encode file}</ucm:Contents>
                </ucm:File>
            </ucm:Document>
        </ucm:Service>
    </ucm:GenericRequest>
</soap:Body>
</soap:Envelope>
Comments
Post Details
Added on Apr 25 2023
0 comments
510 views