3

So I have a workflow set up to send an outbound message containing information regarding the opportunity that was edited. I have it set up to send a message every time an opportunity is edited and the opportunity stage name is 1 of 4 possible values. The problem is, it's sending the message three to 4 times after it is edited and saved. I have a test account in salesforce that I am testing with to see the results. I looked in the outbound message log and am seeing this as the reason that some of the messages are failing because of an "org.xml.sax.SAXParseException: Premature end of file." error. Does anyone know why this would be happening? Perhaps it is trying to send over a field that is halting compilation? I am nit sure. Does any have any ideas? Thanks!

1
  • post the code for your listener.
    – superfell
    Aug 18, 2013 at 2:59

3 Answers 3

5

The error message indicates that the salesforce server started parsing the soap/xml response from your outbound messaging listener, but it got the end of the response data before it got the the valid end of the xml structure. As indicated in the other answers link, this can be for many reasons which you'll need to work through, a bug in your listeners code (like not flushing a buffer, or a problem with exception handling), an issue with an intermediate device (your network firewall or reverse proxy).

The retry link in the outbound messaging monitoring page can help you trigger a message when you can monitor your end. (tools like wireshark & soapscope can help you monitor the http back and forth to you server).

Finally, its worth understanding that OM is an "at least once" delivery service, what this means is that the server will attempt to keep delivering the message until your service has correctly acknowledged the message and importantly that the salesforce server has completed handling your ack. (It will eventually give up after 24 hours) There are numerous failure scenarios where the salesforce service will decide to resend the message, even if your server sent a valid ack, and you need to design your listener with this in mind. (e.g. keep track of successfully processed message ids, and don't do processing on messages Ids you've already received, or implement your listener such that its idempotent).

2

http://boards.developerforce.com/t5/Java-Development/Premature-end-of-file-error-when-sending-outbound-message/m-p/198262#M7707

Refer to the link mentioned it will be helpful

3
  • I saw this post a little while ago, but it didn't quite solve the problem. It doesn't have anything to do with anything I have written. It's just a basic workflow that triggers an outbound message when an opportunity is saved. The outbound message just goes to a php script I have written to communicate with infusionsoft. But some of the messages are getting hung up.
    – jeffro25
    Jul 18, 2013 at 16:25
  • Please check the firewall or proxy if there is any, it might be possible the acknowledgement from other end might not be able to reach ur application because of some firewall or proxy issue.
    – user3170
    Jul 18, 2013 at 16:30
  • Well, some of them get through, which is why I am really baffled. But right now I have a queue of failed messages, all with the same error and I am not quite sure how to fix it, or if it is even something that is fixable.
    – jeffro25
    Jul 18, 2013 at 17:50
0

I've actually figured it out and it was one of your suggestions. I wasn't returning a properly encoded ack, hence it never detected that it was actually received. Thank you all for your advice. It really helped lead me in the right direction. Thanks!

1
  • please mark as answered so this gets removed from the "unanswered" list.
    – pchittum
    Aug 20, 2013 at 1:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .