I have a client who needs a web service method for a 3rd party to send a SOAP call to. But this soap call has two top level nodes in the body.

        <data> blahblahblah </data>
        <moreData> blahblahblah </moreData>
        <evenMoreData> blahblahblah </evenMoreData>

Is this even possible within Salesforce?


Not by using the webservice keyword from Apex. Those are limited to a single return type. The closest you'd probably get is returning a List of something.

You could look at mimicking a SOAP request and response pattern using REST Web Services. These would be annotated for @HttpPost and could expose the RestResponse.responseBody as required.

  • Thank you for the suggestion. Do you know of any other documentation on the REST setup? I have gotten a @HttpGet call working just fine, but am stumbling on the Post. This is what I have been using as reference (developer.salesforce.com/blogs/developer-relations/2012/02/…) I don't know if I am failing on the apex class, the request URL, request body, or all of the above – awh01 Jan 25 at 5:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.