Danish shipping giant Maersk on Thursday posted stronger-than-expected second-quarter operating profit and raised its full-year guidance.