Hi,

I need to add the base64 encoding attachment to parent sObject in
Salesforce. I used the following payload. Could you please suggest a way?
We use the Salesforce partner WSDL.

<payloadFactory>
            <format>
                <soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/";
                    xmlns:urn="urn:partner.soap.sforce.com">
                    <soapenv:Header />
                    <soapenv:Body>
                        <urn:attachment>$1</urn:attachment>
                    </soapenv:Body>
                </soapenv:Envelope>
            </format>
            <args>
<property expression="get-property('attachmentObject')" />

This is the base64 encoding attachment

try {
            Axis2MessageContext axisMsgContext = (Axis2MessageContext)
synCtx;
            org.apache.axis2.context.MessageContext msgContext =
axisMsgContext
                    .getAxis2MessageContext();
            InputStream message = msgContext.attachments
                    .getSOAPPartInputStream();
            byte[] bytes = IOUtils.toByteArray(message);

            String encoded = Base64.encode(bytes);

            synCtx.setProperty("attachmentObject", encoded);

        }

Thanks,
Kathees

-- 
Kathees
Software Engineer,
email: [email protected]
mobile: +94772596173
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to