China and India have agreed to resume trade ties and move towards resolving their longstanding border dispute.